comparison src/process.c @ 90573:858cb33ae39d

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 357-381) - Merge from gnus--rel--5.10 - Update from CVS - Merge from erc--emacs--21 * gnus--rel--5.10 (patch 116-122) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-98
author Miles Bader <miles@gnu.org>
date Thu, 03 Aug 2006 11:45:23 +0000
parents 8a8e69664178 059876b57133
children a1a25ac6c88a
comparison
equal deleted inserted replaced
90572:ab9b8d043c39 90573:858cb33ae39d
4155 This is also used in record_asynch_buffer_change. 4155 This is also used in record_asynch_buffer_change.
4156 For that purpose, this must be 0 4156 For that purpose, this must be 0
4157 when not inside wait_reading_process_output. */ 4157 when not inside wait_reading_process_output. */
4158 static int waiting_for_user_input_p; 4158 static int waiting_for_user_input_p;
4159 4159
4160 static Lisp_Object
4161 wait_reading_process_output_unwind (data)
4162 Lisp_Object data;
4163 {
4164 waiting_for_user_input_p = XINT (data);
4165 return Qnil;
4166 }
4167
4160 /* This is here so breakpoints can be put on it. */ 4168 /* This is here so breakpoints can be put on it. */
4161 static void 4169 static void
4162 wait_reading_process_output_1 () 4170 wait_reading_process_output_1 ()
4163 { 4171 {
4164 } 4172 }
4237 int xerrno; 4245 int xerrno;
4238 Lisp_Object proc; 4246 Lisp_Object proc;
4239 EMACS_TIME timeout, end_time; 4247 EMACS_TIME timeout, end_time;
4240 int wait_channel = -1; 4248 int wait_channel = -1;
4241 int got_some_input = 0; 4249 int got_some_input = 0;
4242 /* Either nil or a cons cell, the car of which is of interest and 4250 int count = SPECPDL_INDEX ();
4243 may be changed outside of this routine. */
4244 int saved_waiting_for_user_input_p = waiting_for_user_input_p;
4245 4251
4246 FD_ZERO (&Available); 4252 FD_ZERO (&Available);
4247 #ifdef NON_BLOCKING_CONNECT 4253 #ifdef NON_BLOCKING_CONNECT
4248 FD_ZERO (&Connecting); 4254 FD_ZERO (&Connecting);
4249 #endif 4255 #endif
4250 4256
4251 /* If wait_proc is a process to watch, set wait_channel accordingly. */ 4257 /* If wait_proc is a process to watch, set wait_channel accordingly. */
4252 if (wait_proc != NULL) 4258 if (wait_proc != NULL)
4253 wait_channel = XINT (wait_proc->infd); 4259 wait_channel = XINT (wait_proc->infd);
4254 4260
4261 record_unwind_protect (wait_reading_process_output_unwind,
4262 make_number (waiting_for_user_input_p));
4255 waiting_for_user_input_p = read_kbd; 4263 waiting_for_user_input_p = read_kbd;
4256 4264
4257 /* Since we may need to wait several times, 4265 /* Since we may need to wait several times,
4258 compute the absolute time to return at. */ 4266 compute the absolute time to return at. */
4259 if (time_limit || microsecs) 4267 if (time_limit || microsecs)
4876 } 4884 }
4877 #endif /* NON_BLOCKING_CONNECT */ 4885 #endif /* NON_BLOCKING_CONNECT */
4878 } /* end for each file descriptor */ 4886 } /* end for each file descriptor */
4879 } /* end while exit conditions not met */ 4887 } /* end while exit conditions not met */
4880 4888
4881 waiting_for_user_input_p = saved_waiting_for_user_input_p; 4889 unbind_to (count, Qnil);
4882 4890
4883 /* If calling from keyboard input, do not quit 4891 /* If calling from keyboard input, do not quit
4884 since we want to return C-g as an input character. 4892 since we want to return C-g as an input character.
4885 Otherwise, do pending quit if requested. */ 4893 Otherwise, do pending quit if requested. */
4886 if (read_kbd >= 0) 4894 if (read_kbd >= 0)