comparison src/process.c @ 72255:a4cd71253e87

* process.c: Revert last change.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 03 Aug 2006 15:19:20 +0000
parents 059876b57133
children a6b9ee835f88
comparison
equal deleted inserted replaced
72254:42b0c9d6a376 72255:a4cd71253e87
4156 This is also used in record_asynch_buffer_change. 4156 This is also used in record_asynch_buffer_change.
4157 For that purpose, this must be 0 4157 For that purpose, this must be 0
4158 when not inside wait_reading_process_output. */ 4158 when not inside wait_reading_process_output. */
4159 static int waiting_for_user_input_p; 4159 static int waiting_for_user_input_p;
4160 4160
4161 static Lisp_Object
4162 wait_reading_process_output_unwind (data)
4163 Lisp_Object data;
4164 {
4165 waiting_for_user_input_p = XINT (data);
4166 return Qnil;
4167 }
4168
4169 /* This is here so breakpoints can be put on it. */ 4161 /* This is here so breakpoints can be put on it. */
4170 static void 4162 static void
4171 wait_reading_process_output_1 () 4163 wait_reading_process_output_1 ()
4172 { 4164 {
4173 } 4165 }
4246 int xerrno; 4238 int xerrno;
4247 Lisp_Object proc; 4239 Lisp_Object proc;
4248 EMACS_TIME timeout, end_time; 4240 EMACS_TIME timeout, end_time;
4249 int wait_channel = -1; 4241 int wait_channel = -1;
4250 int got_some_input = 0; 4242 int got_some_input = 0;
4251 int count = SPECPDL_INDEX (); 4243 /* We can't record_unwind_protect here because after the
4244 set_waiting_for_input call, C-g (interrupt_signal) would run
4245 throw_to_read_char instead of Fsignal, which means unbind_to
4246 doesn't get called. */
4247 int saved_waiting_for_user_input_p = waiting_for_user_input_p;
4252 4248
4253 FD_ZERO (&Available); 4249 FD_ZERO (&Available);
4254 #ifdef NON_BLOCKING_CONNECT 4250 #ifdef NON_BLOCKING_CONNECT
4255 FD_ZERO (&Connecting); 4251 FD_ZERO (&Connecting);
4256 #endif 4252 #endif
4257 4253
4258 /* If wait_proc is a process to watch, set wait_channel accordingly. */ 4254 /* If wait_proc is a process to watch, set wait_channel accordingly. */
4259 if (wait_proc != NULL) 4255 if (wait_proc != NULL)
4260 wait_channel = XINT (wait_proc->infd); 4256 wait_channel = XINT (wait_proc->infd);
4261 4257
4262 record_unwind_protect (wait_reading_process_output_unwind,
4263 make_number (waiting_for_user_input_p));
4264 waiting_for_user_input_p = read_kbd; 4258 waiting_for_user_input_p = read_kbd;
4265 4259
4266 /* Since we may need to wait several times, 4260 /* Since we may need to wait several times,
4267 compute the absolute time to return at. */ 4261 compute the absolute time to return at. */
4268 if (time_limit || microsecs) 4262 if (time_limit || microsecs)
4885 } 4879 }
4886 #endif /* NON_BLOCKING_CONNECT */ 4880 #endif /* NON_BLOCKING_CONNECT */
4887 } /* end for each file descriptor */ 4881 } /* end for each file descriptor */
4888 } /* end while exit conditions not met */ 4882 } /* end while exit conditions not met */
4889 4883
4890 unbind_to (count, Qnil); 4884 waiting_for_user_input_p = saved_waiting_for_user_input_p;
4891 4885
4892 /* If calling from keyboard input, do not quit 4886 /* If calling from keyboard input, do not quit
4893 since we want to return C-g as an input character. 4887 since we want to return C-g as an input character.
4894 Otherwise, do pending quit if requested. */ 4888 Otherwise, do pending quit if requested. */
4895 if (read_kbd >= 0) 4889 if (read_kbd >= 0)