diff options
| author | Chong Yidong | 2006-08-05 01:38:42 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-08-05 01:38:42 +0000 |
| commit | 42ec1561cfb550dc580dd3e163b21289780a2a72 (patch) | |
| tree | 837dd22b964467fc46321d3b8a850be0c7bb5e15 /src/process.c | |
| parent | 092869b9735590049a4be576970c95dc4b53af75 (diff) | |
| download | emacs-42ec1561cfb550dc580dd3e163b21289780a2a72.tar.gz emacs-42ec1561cfb550dc580dd3e163b21289780a2a72.zip | |
* process.c: Reapply 2006-08-01 change.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/process.c b/src/process.c index dc70ef37761..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. */ |
| 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 | |||
| 4161 | /* This is here so breakpoints can be put on it. */ | 4169 | /* This is here so breakpoints can be put on it. */ |
| 4162 | static void | 4170 | static void |
| 4163 | wait_reading_process_output_1 () | 4171 | wait_reading_process_output_1 () |
| @@ -4240,11 +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 | /* We can't record_unwind_protect here because after the | 4251 | int count = SPECPDL_INDEX (); |
| 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; | ||
| 4248 | 4252 | ||
| 4249 | FD_ZERO (&Available); | 4253 | FD_ZERO (&Available); |
| 4250 | #ifdef NON_BLOCKING_CONNECT | 4254 | #ifdef NON_BLOCKING_CONNECT |
| @@ -4255,6 +4259,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4255 | if (wait_proc != NULL) | 4259 | if (wait_proc != NULL) |
| 4256 | wait_channel = XINT (wait_proc->infd); | 4260 | wait_channel = XINT (wait_proc->infd); |
| 4257 | 4261 | ||
| 4262 | record_unwind_protect (wait_reading_process_output_unwind, | ||
| 4263 | make_number (waiting_for_user_input_p)); | ||
| 4258 | waiting_for_user_input_p = read_kbd; | 4264 | waiting_for_user_input_p = read_kbd; |
| 4259 | 4265 | ||
| 4260 | /* Since we may need to wait several times, | 4266 | /* Since we may need to wait several times, |
| @@ -4881,7 +4887,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4881 | } /* end for each file descriptor */ | 4887 | } /* end for each file descriptor */ |
| 4882 | } /* end while exit conditions not met */ | 4888 | } /* end while exit conditions not met */ |
| 4883 | 4889 | ||
| 4884 | waiting_for_user_input_p = saved_waiting_for_user_input_p; | 4890 | unbind_to (count, Qnil); |
| 4885 | 4891 | ||
| 4886 | /* If calling from keyboard input, do not quit | 4892 | /* If calling from keyboard input, do not quit |
| 4887 | since we want to return C-g as an input character. | 4893 | since we want to return C-g as an input character. |