summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorMatthias Dahl <matthias.dahl@binary-island.eu>2018-02-16 17:57:40 +0200
committerEli Zaretskii <eliz@gnu.org>2018-02-16 17:57:40 +0200
commit4ba32858d61eee16f17b51aca01c15211a0912f8 (patch)
treea775831b32002629415087e663698c2b32decbee /src/xterm.c
parent49fc040077b33bd1e78ee425575e76329b772a41 (diff)
downloademacs-4ba32858d61eee16f17b51aca01c15211a0912f8.tar.gz
emacs-4ba32858d61eee16f17b51aca01c15211a0912f8.tar.bz2
emacs-4ba32858d61eee16f17b51aca01c15211a0912f8.zip
Fix wait_reading_process_output wait_proc hang
* src/process.c (read_process_output): Track bytes read from a process. (wait_reading_process_output): If called recursively through timers and/or process filters via accept-process-output, it is possible that the output of wait_proc has already been read by one of those recursive calls, leaving the original call hanging forever if no further output arrives through that fd and no timeout has been set. Fix that by using the process read accounting to keep track of how many bytes have been read and use that as a condition to break out of the infinite loop and return to the caller as well as to calculate the proper return value (if a wait_proc is given that is). * src/process.h (struct Lisp_Process): Add nbytes_read to track bytes read from a process.
Diffstat (limited to 'src/xterm.c')
0 files changed, 0 insertions, 0 deletions