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