[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20978: [PATCH 7/7] Avoid returning early reading process output due
From: |
Ian Kelling |
Subject: |
bug#20978: [PATCH 7/7] Avoid returning early reading process output due to SIGIO |
Date: |
Sat, 04 Jul 2015 05:48:11 -0700 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) |
* 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.
diff --git a/src/process.c b/src/process.c
index 052f94e..f64a064 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4967,12 +4967,17 @@ wait_reading_process_output (intmax_t time_limit, int
nsecs, int read_kbd,
if (nfds == 0)
{
+ /* If we've past the requested timeout, or got some output
+ and aren't skipping processes, and haven't lowered our
+ timeout due to timers or SIGIO, or 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 == MINIMUM
|| (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;
}
--
2.4.5
- bug#20978: 25.0.50; [PATCH 0/7] Emacs can return too fast when reading from any processes, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 1/7] ; Minor cleanup of wait_reading_process_output, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 2/7] ; Remove ADAPTIVE_READ_BUFFERING ifdef, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 3/7] ; Rename local var to match function name, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 4/7] ; Rename local var nsecs to adaptive_nsecs, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 5/7] : Refactor timeouts in wait_reading_process_output, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 6/7] Don't return as fast reading any process output, Ian Kelling, 2015/07/04
- bug#20978: [PATCH 7/7] Avoid returning early reading process output due to SIGIO,
Ian Kelling <=
- bug#20978: 25.0.50; [PATCH 0/7] Emacs can return too fast when reading from any processes, Eli Zaretskii, 2015/07/04
bug#20978: 25.0.50; [PATCH 0/7] Emacs can return too fast when reading from any processes, Ian Kelling, 2015/07/04
bug#20978: 25.0.50; [PATCH 0/7] Emacs can return too fast when reading from any processes, Paul Eggert, 2015/07/05