]> git.eshelyaron.com Git - emacs.git/commitdiff
* keyboard.c (kbd_buffer_get_event): Read file notification events
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 4 Feb 2014 11:40:31 +0000 (12:40 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 4 Feb 2014 11:40:31 +0000 (12:40 +0100)
also in batch mode.

* xgselect.c (xg_select): Read glib events in any case, even if
there are no file descriptors to watch for.  (Bug#16519)

src/ChangeLog
src/keyboard.c
src/xgselect.c

index ec003cd59b21b041b7bb104331bb6ab919e76cb6..746bdffad222044780ced8defc750bce5061c351 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * keyboard.c (kbd_buffer_get_event): Read file notification events
+       also in batch mode.
+
+       * xgselect.c (xg_select): Read glib events in any case, even if
+       there are no file descriptors to watch for.  (Bug#16519)
+
 2014-02-03  Martin Rudalics  <rudalics@gmx.at>
 
        * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID
index 5430e7971b463c6a4470f42a9d2f7520de0c76ad..c1de4dafcdd57583500603c85758a7e8e506710d 100644 (file)
@@ -3820,7 +3820,7 @@ kbd_buffer_get_event (KBOARD **kbp,
     }
 #endif /* subprocesses */
 
-#ifndef HAVE_DBUS  /* We want to read D-Bus events in batch mode.  */
+#if !defined HAVE_DBUS && !defined USE_FILE_NOTIFY
   if (noninteractive
       /* In case we are running as a daemon, only do this before
         detaching from the terminal.  */
@@ -3831,7 +3831,7 @@ kbd_buffer_get_event (KBOARD **kbp,
       *kbp = current_kboard;
       return obj;
     }
-#endif /* ! HAVE_DBUS  */
+#endif /* !defined HAVE_DBUS && !defined USE_FILE_NOTIFY  */
 
   /* Wait until there is input available.  */
   for (;;)
index 699965cfda17b422c4f4c7fedb51dd4c5ddd7a53..a281414610a9ab1e7f252155c32c7934779b668e 100644 (file)
@@ -124,23 +124,19 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
         }
     }
 
-  if (our_fds > 0 || (nfds == 0 && tmop == &tmo))
-    {
-
-      /* If Gtk+ is in use eventually gtk_main_iteration will be called,
-         unless retval is zero.  */
+  /* If Gtk+ is in use eventually gtk_main_iteration will be called,
+     unless retval is zero.  */
 #ifdef USE_GTK
-      if (retval == 0)
+  if (retval == 0)
 #endif
-        while (g_main_context_pending (context))
-          g_main_context_dispatch (context);
+    while (g_main_context_pending (context))
+      g_main_context_dispatch (context);
 
-      /* To not have to recalculate timeout, return like this.  */
-      if (retval == 0)
-        {
-          retval = -1;
-          errno = EINTR;
-        }
+  /* To not have to recalculate timeout, return like this.  */
+  if ((our_fds > 0 || (nfds == 0 && tmop == &tmo)) && (retval == 0))
+    {
+      retval = -1;
+      errno = EINTR;
     }
 
   return retval;