aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c10
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