comparison src/process.c @ 77647:73b045a7fa70

(Faccept_process_output): Revert 2006-03-22 change so that the third argument once again is in microseconds (not milliseconds). This makes it compatible with Emacs 21 and earlier. Problem found by Henrik Rindlw.
author Richard M. Stallman <rms@gnu.org>
date Sat, 05 May 2007 04:02:09 +0000
parents 4f679f6070a0
children dd2237126840
comparison
equal deleted inserted replaced
77646:6187b5730b6e 77647:73b045a7fa70
3910 doc: /* Allow any pending output from subprocesses to be read by Emacs. 3910 doc: /* Allow any pending output from subprocesses to be read by Emacs.
3911 It is read into the process' buffers or given to their filter functions. 3911 It is read into the process' buffers or given to their filter functions.
3912 Non-nil arg PROCESS means do not return until some output has been received 3912 Non-nil arg PROCESS means do not return until some output has been received
3913 from PROCESS. 3913 from PROCESS.
3914 3914
3915 Non-nil second arg SECONDS and third arg MILLISEC are number of 3915 Non-nil second arg SECONDS and third arg MICROSEC are number of
3916 seconds and milliseconds to wait; return after that much time whether 3916 seconds and microseconds to wait; return after that much time whether
3917 or not there is input. If SECONDS is a floating point number, 3917 or not there is input. If SECONDS is a floating point number,
3918 it specifies a fractional number of seconds to wait. 3918 it specifies a fractional number of seconds to wait.
3919 3919
3920 If optional fourth arg JUST-THIS-ONE is non-nil, only accept output 3920 If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
3921 from PROCESS, suspending reading output from other processes. 3921 from PROCESS, suspending reading output from other processes.
3922 If JUST-THIS-ONE is an integer, don't run any timers either. 3922 If JUST-THIS-ONE is an integer, don't run any timers either.
3923 Return non-nil iff we received any output before the timeout expired. */) 3923 Return non-nil iff we received any output before the timeout expired. */)
3924 (process, seconds, millisec, just_this_one) 3924 (process, seconds, microsec, just_this_one)
3925 register Lisp_Object process, seconds, millisec, just_this_one; 3925 register Lisp_Object process, seconds, microsec, just_this_one;
3926 { 3926 {
3927 int secs, usecs = 0; 3927 int secs, usecs = 0;
3928 3928
3929 if (! NILP (process)) 3929 if (! NILP (process))
3930 CHECK_PROCESS (process); 3930 CHECK_PROCESS (process);
3942 usecs = (int) ((timeout - (double) secs) * 1000000); 3942 usecs = (int) ((timeout - (double) secs) * 1000000);
3943 } 3943 }
3944 else 3944 else
3945 wrong_type_argument (Qnumberp, seconds); 3945 wrong_type_argument (Qnumberp, seconds);
3946 3946
3947 if (INTEGERP (millisec)) 3947 if (INTEGERP (microsec))
3948 { 3948 {
3949 int carry; 3949 int carry;
3950 usecs += XINT (millisec) * 1000; 3950 usecs += XINT (microsec);
3951 carry = usecs / 1000000; 3951 carry = usecs / 1000000;
3952 secs += carry; 3952 secs += carry;
3953 if ((usecs -= carry * 1000000) < 0) 3953 if ((usecs -= carry * 1000000) < 0)
3954 { 3954 {
3955 secs--; 3955 secs--;