aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/process.c b/src/process.c
index 9dadc1ab4ab..f8ae50e8652 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4163,6 +4163,14 @@ server_accept_connection (server, channel)
4163 when not inside wait_reading_process_output. */ 4163 when not inside wait_reading_process_output. */
4164static int waiting_for_user_input_p; 4164static int waiting_for_user_input_p;
4165 4165
4166static Lisp_Object
4167wait_reading_process_output_unwind (data)
4168 Lisp_Object data;
4169{
4170 waiting_for_user_input_p = XINT (data);
4171 return Qnil;
4172}
4173
4166/* This is here so breakpoints can be put on it. */ 4174/* This is here so breakpoints can be put on it. */
4167static void 4175static void
4168wait_reading_process_output_1 () 4176wait_reading_process_output_1 ()
@@ -4245,9 +4253,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4245 EMACS_TIME timeout, end_time; 4253 EMACS_TIME timeout, end_time;
4246 int wait_channel = -1; 4254 int wait_channel = -1;
4247 int got_some_input = 0; 4255 int got_some_input = 0;
4248 /* Either nil or a cons cell, the car of which is of interest and 4256 int count = SPECPDL_INDEX ();
4249 may be changed outside of this routine. */
4250 int saved_waiting_for_user_input_p = waiting_for_user_input_p;
4251 4257
4252 FD_ZERO (&Available); 4258 FD_ZERO (&Available);
4253#ifdef NON_BLOCKING_CONNECT 4259#ifdef NON_BLOCKING_CONNECT
@@ -4258,6 +4264,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4258 if (wait_proc != NULL) 4264 if (wait_proc != NULL)
4259 wait_channel = XINT (wait_proc->infd); 4265 wait_channel = XINT (wait_proc->infd);
4260 4266
4267 record_unwind_protect (wait_reading_process_output_unwind,
4268 make_number (waiting_for_user_input_p));
4261 waiting_for_user_input_p = read_kbd; 4269 waiting_for_user_input_p = read_kbd;
4262 4270
4263 /* Since we may need to wait several times, 4271 /* Since we may need to wait several times,
@@ -4884,7 +4892,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4884 } /* end for each file descriptor */ 4892 } /* end for each file descriptor */
4885 } /* end while exit conditions not met */ 4893 } /* end while exit conditions not met */
4886 4894
4887 waiting_for_user_input_p = saved_waiting_for_user_input_p; 4895 unbind_to (count, Qnil);
4888 4896
4889 /* If calling from keyboard input, do not quit 4897 /* If calling from keyboard input, do not quit
4890 since we want to return C-g as an input character. 4898 since we want to return C-g as an input character.