From 86d2bf49962c66f19e467804dfcfb5153b460f51 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 4 Feb 2014 12:40:31 +0100 Subject: [PATCH] * 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) --- src/ChangeLog | 8 ++++++++ src/keyboard.c | 4 ++-- src/xgselect.c | 24 ++++++++++-------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ec003cd59b2..746bdffad22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2014-02-04 Michael Albinus + + * 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 * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID diff --git a/src/keyboard.c b/src/keyboard.c index 5430e7971b4..c1de4dafcdd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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 (;;) diff --git a/src/xgselect.c b/src/xgselect.c index 699965cfda1..a281414610a 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -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; -- 2.39.2