diff options
| author | Paul Eggert | 2012-07-09 14:12:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-09 14:12:08 -0700 |
| commit | a0bee46f5ab47acd95dee9e022792ff0db3ff336 (patch) | |
| tree | f0be340854071380be3b8d204c4195b00c2e82a5 /src/process.c | |
| parent | e00c793aece0c871db801f99a46c877f0b4e26e0 (diff) | |
| download | emacs-a0bee46f5ab47acd95dee9e022792ff0db3ff336.tar.gz emacs-a0bee46f5ab47acd95dee9e022792ff0db3ff336.zip | |
* process.c (wait_reading_process_output): 'waitchannels' was unset
when read_kbd || !NILP (wait_for_cell); fix this.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/process.c b/src/process.c index 7e9d746a450..b8c3a18b33d 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4239,7 +4239,7 @@ wait_reading_process_output_1 (void) | |||
| 4239 | If NSECS > 0, the timeout consists of NSECS only. | 4239 | If NSECS > 0, the timeout consists of NSECS only. |
| 4240 | If NSECS < 0, gobble data immediately, as if TIME_LIMIT were negative. | 4240 | If NSECS < 0, gobble data immediately, as if TIME_LIMIT were negative. |
| 4241 | 4241 | ||
| 4242 | READ_KBD is a lisp value: | 4242 | READ_KBD is: |
| 4243 | 0 to ignore keyboard input, or | 4243 | 0 to ignore keyboard input, or |
| 4244 | 1 to return when input is available, or | 4244 | 1 to return when input is available, or |
| 4245 | -1 meaning caller will actually read the input, so don't throw to | 4245 | -1 meaning caller will actually read the input, so don't throw to |
| @@ -6820,7 +6820,7 @@ extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, | |||
| 6820 | If NSECS > 0, the timeout consists of NSECS only. | 6820 | If NSECS > 0, the timeout consists of NSECS only. |
| 6821 | If NSECS < 0, gobble data immediately, as if TIME_LIMIT were negative. | 6821 | If NSECS < 0, gobble data immediately, as if TIME_LIMIT were negative. |
| 6822 | 6822 | ||
| 6823 | READ_KBD is a Lisp_Object: | 6823 | READ_KBD is: |
| 6824 | 0 to ignore keyboard input, or | 6824 | 0 to ignore keyboard input, or |
| 6825 | 1 to return when input is available, or | 6825 | 1 to return when input is available, or |
| 6826 | -1 means caller will actually read the input, so don't throw to | 6826 | -1 means caller will actually read the input, so don't throw to |
| @@ -6842,8 +6842,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6842 | { | 6842 | { |
| 6843 | register int nfds; | 6843 | register int nfds; |
| 6844 | EMACS_TIME end_time, timeout; | 6844 | EMACS_TIME end_time, timeout; |
| 6845 | SELECT_TYPE waitchannels; | ||
| 6846 | int xerrno; | ||
| 6847 | 6845 | ||
| 6848 | if (time_limit < 0) | 6846 | if (time_limit < 0) |
| 6849 | { | 6847 | { |
| @@ -6870,6 +6868,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6870 | while (1) | 6868 | while (1) |
| 6871 | { | 6869 | { |
| 6872 | int timeout_reduced_for_timers = 0; | 6870 | int timeout_reduced_for_timers = 0; |
| 6871 | SELECT_TYPE waitchannels; | ||
| 6872 | int xerrno; | ||
| 6873 | 6873 | ||
| 6874 | /* If calling from keyboard input, do not quit | 6874 | /* If calling from keyboard input, do not quit |
| 6875 | since we want to return C-g as an input character. | 6875 | since we want to return C-g as an input character. |
| @@ -6944,13 +6944,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6944 | if (read_kbd < 0) | 6944 | if (read_kbd < 0) |
| 6945 | set_waiting_for_input (&timeout); | 6945 | set_waiting_for_input (&timeout); |
| 6946 | 6946 | ||
| 6947 | /* Wait till there is something to do. */ | ||
| 6948 | |||
| 6949 | if (! read_kbd && NILP (wait_for_cell)) | ||
| 6950 | FD_ZERO (&waitchannels); | ||
| 6951 | else | ||
| 6952 | FD_SET (0, &waitchannels); | ||
| 6953 | |||
| 6954 | /* If a frame has been newly mapped and needs updating, | 6947 | /* If a frame has been newly mapped and needs updating, |
| 6955 | reprocess its display stuff. */ | 6948 | reprocess its display stuff. */ |
| 6956 | if (frame_garbaged && do_display) | 6949 | if (frame_garbaged && do_display) |
| @@ -6961,13 +6954,16 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6961 | set_waiting_for_input (&timeout); | 6954 | set_waiting_for_input (&timeout); |
| 6962 | } | 6955 | } |
| 6963 | 6956 | ||
| 6957 | /* Wait till there is something to do. */ | ||
| 6958 | FD_ZERO (&waitchannels); | ||
| 6964 | if (read_kbd && detect_input_pending ()) | 6959 | if (read_kbd && detect_input_pending ()) |
| 6960 | nfds = 0; | ||
| 6961 | else | ||
| 6965 | { | 6962 | { |
| 6966 | nfds = 0; | 6963 | if (read_kbd || !NILP (wait_for_cell)) |
| 6967 | FD_ZERO (&waitchannels); | 6964 | FD_SET (0, &waitchannels); |
| 6965 | nfds = pselect (1, &waitchannels, NULL, NULL, &timeout, NULL); | ||
| 6968 | } | 6966 | } |
| 6969 | else | ||
| 6970 | nfds = pselect (1, &waitchannels, NULL, NULL, &timeout, NULL); | ||
| 6971 | 6967 | ||
| 6972 | xerrno = errno; | 6968 | xerrno = errno; |
| 6973 | 6969 | ||