aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPaul Eggert2016-07-03 10:49:21 +0200
committerPaul Eggert2016-07-03 10:50:31 +0200
commit1e97ecb964a478e8b2f08b628695ac02b923eabe (patch)
tree81fd6f937ec4180bd451ba508a76081ecfe3d9f2 /src/process.c
parent08974112ae68aefba658a8516c8faa3374edc924 (diff)
downloademacs-1e97ecb964a478e8b2f08b628695ac02b923eabe.tar.gz
emacs-1e97ecb964a478e8b2f08b628695ac02b923eabe.zip
Fix open-network-stream responsiveness
Problem reported by Constantin Kulikov (Bug#23684). * src/process.c (wait_reading_process_output): Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when wait == INFINITY and got_output_end_time is invalid. In this case the code should break, not continue.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c
index ed0c529cd75..376e87230df 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5269,16 +5269,20 @@ 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;
5273 bool have_cmp_time = false;
5272 if (wait < TIMEOUT) 5274 if (wait < TIMEOUT)
5273 break; 5275 break;
5274 struct timespec cmp_time 5276 else if (wait == TIMEOUT)
5275 = (wait == TIMEOUT 5277 cmp_time = end_time, have_cmp_time = true;
5276 ? end_time 5278 else if (!process_skipped && got_some_output > 0
5277 : (!process_skipped && got_some_output > 0 5279 && (timeout.tv_sec > 0 || timeout.tv_nsec > 0))
5278 && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) 5280 {
5279 ? got_output_end_time 5281 if (!timespec_valid_p (got_output_end_time))
5280 : invalid_timespec ()); 5282 break;
5281 if (timespec_valid_p (cmp_time)) 5283 cmp_time = got_output_end_time, have_cmp_time = true;
5284 }
5285 if (have_cmp_time)
5282 { 5286 {
5283 now = current_timespec (); 5287 now = current_timespec ();
5284 if (timespec_cmp (cmp_time, now) <= 0) 5288 if (timespec_cmp (cmp_time, now) <= 0)