comparison src/process.c @ 14404:cba05f90ee57

(wait_reading_process_input): Call timer_check and shorten the inner delay if appropriate.
author Richard M. Stallman <rms@gnu.org>
date Mon, 29 Jan 1996 04:50:16 +0000
parents 3562c5f43780
children 4aa693528ee3
comparison
equal deleted inserted replaced
14403:c91cf5d2b95f 14404:cba05f90ee57
247 /* Don't make static; need to access externally. */ 247 /* Don't make static; need to access externally. */
248 int proc_buffered_char[MAXDESC]; 248 int proc_buffered_char[MAXDESC];
249 249
250 static Lisp_Object get_process (); 250 static Lisp_Object get_process ();
251 251
252 extern EMACS_TIME timer_check ();
253
252 /* Maximum number of bytes to send to a pty without an eof. */ 254 /* Maximum number of bytes to send to a pty without an eof. */
253 static int pty_max_bytes; 255 static int pty_max_bytes;
254 256
255 #ifdef HAVE_PTYS 257 #ifdef HAVE_PTYS
256 /* The file name of the pty opened by allocate_pty. */ 258 /* The file name of the pty opened by allocate_pty. */
2049 break; 2051 break;
2050 } 2052 }
2051 else 2053 else
2052 { 2054 {
2053 EMACS_SET_SECS_USECS (timeout, 100000, 0); 2055 EMACS_SET_SECS_USECS (timeout, 100000, 0);
2056 }
2057
2058 /* If our caller will not immediately handle keyboard events,
2059 run timer events directly.
2060 (Callers that will immediately read keyboard events
2061 call timer_delay on their own.) */
2062 if (read_kbd >= 0)
2063 {
2064 EMACS_TIME timer_delay = timer_check (1);
2065 if (! EMACS_TIME_NEG_P (timer_delay))
2066 {
2067 EMACS_TIME difference;
2068 EMACS_SUB_TIME (difference, timer_delay, timeout);
2069 if (EMACS_TIME_NEG_P (difference))
2070 timeout = timer_delay;
2071 }
2054 } 2072 }
2055 2073
2056 /* Cause C-g and alarm signals to take immediate action, 2074 /* Cause C-g and alarm signals to take immediate action,
2057 and cause input available signals to zero out timeout. 2075 and cause input available signals to zero out timeout.
2058 2076