diff options
| author | Paul Eggert | 2016-07-04 00:46:57 +0200 |
|---|---|---|
| committer | Paul Eggert | 2016-07-04 00:47:41 +0200 |
| commit | 838f122873edbc0cff1ebe3645803e674e812774 (patch) | |
| tree | 1b541dec216fd4661233269ac4ab8999d88f274e /src/process.c | |
| parent | 9e54c5250d87e64a4a7f2423f217c4444bcf3449 (diff) | |
| download | emacs-838f122873edbc0cff1ebe3645803e674e812774.tar.gz emacs-838f122873edbc0cff1ebe3645803e674e812774.zip | |
Re-fix open-network-stream responsiveness
Problem reported by Christer Ekholm (Bug#23864).
* src/process.c (wait_reading_process_output): Further fix for
typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when
wait == INFINITY and got_output_end_time is invalid. See:
http://bugs.gnu.org/23864#20
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index 376e87230df..bdbdefabb64 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5269,20 +5269,22 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5269 | haven't lowered our timeout due to timers or SIGIO and | 5269 | haven't lowered our timeout due to timers or SIGIO and |
| 5270 | have waited a long amount of time due to repeated | 5270 | have waited a long amount of time due to repeated |
| 5271 | timers. */ | 5271 | timers. */ |
| 5272 | struct timespec cmp_time; | 5272 | struct timespec huge_timespec |
| 5273 | bool have_cmp_time = false; | 5273 | = make_timespec (TYPE_MAXIMUM (time_t), 2 * TIMESPEC_RESOLUTION); |
| 5274 | struct timespec cmp_time = huge_timespec; | ||
| 5274 | if (wait < TIMEOUT) | 5275 | if (wait < TIMEOUT) |
| 5275 | break; | 5276 | break; |
| 5276 | else if (wait == TIMEOUT) | 5277 | if (wait == TIMEOUT) |
| 5277 | cmp_time = end_time, have_cmp_time = true; | 5278 | cmp_time = end_time; |
| 5278 | else if (!process_skipped && got_some_output > 0 | 5279 | if (!process_skipped && got_some_output > 0 |
| 5279 | && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) | 5280 | && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) |
| 5280 | { | 5281 | { |
| 5281 | if (!timespec_valid_p (got_output_end_time)) | 5282 | if (!timespec_valid_p (got_output_end_time)) |
| 5282 | break; | 5283 | break; |
| 5283 | cmp_time = got_output_end_time, have_cmp_time = true; | 5284 | if (timespec_cmp (got_output_end_time, cmp_time) < 0) |
| 5285 | cmp_time = got_output_end_time; | ||
| 5284 | } | 5286 | } |
| 5285 | if (have_cmp_time) | 5287 | if (timespec_cmp (cmp_time, huge_timespec) < 0) |
| 5286 | { | 5288 | { |
| 5287 | now = current_timespec (); | 5289 | now = current_timespec (); |
| 5288 | if (timespec_cmp (cmp_time, now) <= 0) | 5290 | if (timespec_cmp (cmp_time, now) <= 0) |