diff options
| author | Ian Kelling | 2015-07-05 18:14:25 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-07-05 19:21:49 -0700 |
| commit | f469c17b9c869b400b3515535b2f1fd9dd00f9a0 (patch) | |
| tree | 4e42758984133d29002086eda62800668b746c42 /src/process.c | |
| parent | 12a2691fb254db20607b2067a12b795a6d7c6649 (diff) | |
| download | emacs-f469c17b9c869b400b3515535b2f1fd9dd00f9a0.tar.gz emacs-f469c17b9c869b400b3515535b2f1fd9dd00f9a0.zip | |
Avoid returning early reading process output due to SIGIO
* src/process.c (wait_reading_process_output): Extend the behavior of
not breaking due to not finding output when a timer has lowered the
timeout to include when SIGIO lowers the timeout.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c index 8e046a6dd11..8a8dad793ad 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4960,12 +4960,18 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4960 | 4960 | ||
| 4961 | if (nfds == 0) | 4961 | if (nfds == 0) |
| 4962 | { | 4962 | { |
| 4963 | /* Exit the main loop if we've passed the requested timeout, | ||
| 4964 | or aren't skipping processes and got some output and | ||
| 4965 | haven't lowered our timeout due to timers or SIGIO and | ||
| 4966 | have waited a long amount of time due to repeated | ||
| 4967 | timers. */ | ||
| 4963 | struct timespec now = current_timespec (); | 4968 | struct timespec now = current_timespec (); |
| 4964 | if ((timeout.tv_sec == 0 && timeout.tv_nsec == 0) | 4969 | if (wait < TIMEOUT |
| 4965 | || (wait == TIMEOUT && timespec_cmp (end_time, now) <= 0) | 4970 | || (wait == TIMEOUT && timespec_cmp (end_time, now) <= 0) |
| 4966 | || (!process_skipped && got_some_output > 0 | 4971 | || (!process_skipped && got_some_output > 0 |
| 4967 | && (!timespec_valid_p (got_output_end_time) | 4972 | && (!timespec_valid_p (got_output_end_time) |
| 4968 | || timespec_cmp (got_output_end_time, now) <= 0))) | 4973 | || timespec_cmp (got_output_end_time, now) <= 0) |
| 4974 | && (timeout.tv_sec > 0 || timeout.tv_nsec > 0))) | ||
| 4969 | break; | 4975 | break; |
| 4970 | } | 4976 | } |
| 4971 | 4977 | ||