diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 1fc3cfeef44..7833fe3d01c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5679,8 +5679,16 @@ additional wait period, in milliseconds; this is for backwards compatibility. | |||
| 5679 | if (duration > 0) | 5679 | if (duration > 0) |
| 5680 | { | 5680 | { |
| 5681 | struct timespec t = dtotimespec (duration); | 5681 | struct timespec t = dtotimespec (duration); |
| 5682 | wait_reading_process_output (min (t.tv_sec, WAIT_READING_MAX), | 5682 | struct timespec tend = timespec_add (current_timespec (), t); |
| 5683 | t.tv_nsec, 0, 0, Qnil, NULL, 0); | 5683 | |
| 5684 | /* wait_reading_process_output returns as soon as it detects | ||
| 5685 | output from any subprocess, so we wait in a loop until the | ||
| 5686 | time expires. */ | ||
| 5687 | do { | ||
| 5688 | wait_reading_process_output (min (t.tv_sec, WAIT_READING_MAX), | ||
| 5689 | t.tv_nsec, 0, 0, Qnil, NULL, 0); | ||
| 5690 | t = timespec_sub (tend, current_timespec ()); | ||
| 5691 | } while (timespec_sign (t) > 0); | ||
| 5684 | } | 5692 | } |
| 5685 | 5693 | ||
| 5686 | return Qnil; | 5694 | return Qnil; |