From: Paul Eggert Date: Wed, 16 May 2012 02:22:53 +0000 (-0700) Subject: * xgselect.c (xg_select): Just invoke 'select' if -nw. X-Git-Tag: emacs-24.2.90~471^2~66 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b05725233bee74ae0bd58aebbcb90302abe2cb00;p=emacs.git * xgselect.c (xg_select): Just invoke 'select' if -nw. Suggested by Ken Brown. Fixes: debbugs:9754 --- diff --git a/src/ChangeLog b/src/ChangeLog index 484df557e6e..63661f5d27a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 Paul Eggert + + * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754). + 2012-05-15 Stefan Monnier * lread.c (init_obarray): Declare Qt and Qnil as special. diff --git a/src/xgselect.c b/src/xgselect.c index 7a09c37c50d..8b5ee68e55b 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -38,17 +38,21 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, SELECT_TYPE all_rfds, all_wfds; EMACS_TIME tmo, *tmop = timeout; - GMainContext *context = g_main_context_default (); + GMainContext *context; int have_wfds = wfds != NULL; int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0; int i, nfds, fds_lim, tmo_in_millisec; + if (inhibit_window_system || !display_arg) + return select (max_fds, rfds, wfds, efds, timeout); + if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); else FD_ZERO (&all_rfds); if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); else FD_ZERO (&all_wfds); /* Update event sources in GLib. */ + context = g_main_context_default (); g_main_context_pending (context); do {