aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c
index c51d862969b..f8a8445e764 100644
--- a/src/process.c
+++ b/src/process.c
@@ -107,6 +107,8 @@ Boston, MA 02111-1307, USA. */
107#include "frame.h" 107#include "frame.h"
108#include "blockinput.h" 108#include "blockinput.h"
109 109
110#define max(a, b) ((a) > (b) ? (a) : (b))
111
110Lisp_Object Qprocessp; 112Lisp_Object Qprocessp;
111Lisp_Object Qrun, Qstop, Qsignal, Qopen, Qclosed; 113Lisp_Object Qrun, Qstop, Qsignal, Qopen, Qclosed;
112Lisp_Object Qlast_nonmenu_event; 114Lisp_Object Qlast_nonmenu_event;
@@ -2288,7 +2290,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2288 { 2290 {
2289 Atemp = input_wait_mask; 2291 Atemp = input_wait_mask;
2290 EMACS_SET_SECS_USECS (timeout, 0, 0); 2292 EMACS_SET_SECS_USECS (timeout, 0, 0);
2291 if ((select (MAXDESC, &Atemp, (SELECT_TYPE *)0, (SELECT_TYPE *)0, 2293 if ((select (max (max_process_desc, max_keyboard_desc) + 1,
2294 &Atemp, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
2292 &timeout) 2295 &timeout)
2293 <= 0)) 2296 <= 0))
2294 { 2297 {
@@ -2349,7 +2352,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2349 FD_ZERO (&Available); 2352 FD_ZERO (&Available);
2350 } 2353 }
2351 else 2354 else
2352 nfds = select (MAXDESC, &Available, (SELECT_TYPE *)0, (SELECT_TYPE *)0, 2355 nfds = select (max (max_process_desc, max_keyboard_desc) + 1,
2356 &Available, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
2353 &timeout); 2357 &timeout);
2354 2358
2355 xerrno = errno; 2359 xerrno = errno;
@@ -2445,21 +2449,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2445 && requeued_events_pending_p ()) 2449 && requeued_events_pending_p ())
2446 break; 2450 break;
2447 2451
2448#if 0
2449 /* If wait_for_cell. check for keyboard input 2452 /* If wait_for_cell. check for keyboard input
2450 but don't run any timers. 2453 but don't run any timers.
2451 ??? (It seems wrong to me to check for keyboard 2454 The reason for this is so that X events will be processed.
2452 input at all when wait_for_cell, but the code 2455 Otherwise they may have to wait until polling takes place.
2453 has been this way since July 1994. 2456 That would causes delays in pasting selections, for example. */
2454 Try changing this after version 19.31.) */
2455 if (wait_for_cell 2457 if (wait_for_cell
2456 && detect_input_pending ()) 2458 && detect_input_pending ())
2457 { 2459 {
2458 swallow_events (do_display); 2460 swallow_events (do_display);
2461#if 0 /* Exiting when read_kbd doesn't request that seems wrong, though. */
2459 if (detect_input_pending ()) 2462 if (detect_input_pending ())
2460 break; 2463 break;
2461 }
2462#endif 2464#endif
2465 }
2463 2466
2464 /* Exit now if the cell we're waiting for became non-nil. */ 2467 /* Exit now if the cell we're waiting for became non-nil. */
2465 if (wait_for_cell && ! NILP (*wait_for_cell)) 2468 if (wait_for_cell && ! NILP (*wait_for_cell))