[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master f469c17 7/8: Avoid returning early reading process
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master f469c17 7/8: Avoid returning early reading process output due to SIGIO |
Date: |
Mon, 06 Jul 2015 02:21:57 +0000 |
branch: master
commit f469c17b9c869b400b3515535b2f1fd9dd00f9a0
Author: Ian Kelling <address@hidden>
Commit: Paul Eggert <address@hidden>
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.
---
src/process.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/process.c b/src/process.c
index 8e046a6..8a8dad7 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,
if (nfds == 0)
{
+ /* Exit the main loop if we've passed the requested timeout,
+ or aren't skipping processes and got some output and
+ haven't lowered our timeout due to timers or SIGIO and
+ have waited a long amount of time due to repeated
+ timers. */
struct timespec now = current_timespec ();
- if ((timeout.tv_sec == 0 && timeout.tv_nsec == 0)
+ if (wait < TIMEOUT
|| (wait == TIMEOUT && timespec_cmp (end_time, now) <= 0)
|| (!process_skipped && got_some_output > 0
&& (!timespec_valid_p (got_output_end_time)
- || timespec_cmp (got_output_end_time, now) <= 0)))
+ || timespec_cmp (got_output_end_time, now) <= 0)
+ && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)))
break;
}
- [Emacs-diffs] master updated (904be87 -> ad236260), Paul Eggert, 2015/07/05
- [Emacs-diffs] master 0815082 1/8: ; Minor cleanup of wait_reading_process_output, Paul Eggert, 2015/07/05
- [Emacs-diffs] master 91cbc7b 4/8: ; Rename local var nsecs to adaptive_nsecs, Paul Eggert, 2015/07/05
- [Emacs-diffs] master f469c17 7/8: Avoid returning early reading process output due to SIGIO,
Paul Eggert <=
- [Emacs-diffs] master 082eda1 3/8: ; Rename local var to match function name, Paul Eggert, 2015/07/05
- [Emacs-diffs] master ad236260 8/8: Avoid duplicate calls to current_timespec, Paul Eggert, 2015/07/05
- [Emacs-diffs] master 12a2691 6/8: Don't return as fast reading any process output, Paul Eggert, 2015/07/05
- [Emacs-diffs] master 6e2fcc2 5/8: Refactor timeouts in wait_reading_process_output, Paul Eggert, 2015/07/05
- [Emacs-diffs] master 5dc66db 2/8: Remove ADAPTIVE_READ_BUFFERING ifdef, Paul Eggert, 2015/07/05