diff options
| author | Spencer Baugh | 2025-09-30 14:47:51 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2025-10-11 12:22:17 +0300 |
| commit | c172b6dded4f92f47f035b724605ecbb0e19970c (patch) | |
| tree | 2f7761b8cc6d2066b643e71e8496f7aa3a5cdee4 /src/process.c | |
| parent | 443af6fe1d0161142af0bc4578efd0653c3f1be9 (diff) | |
| download | emacs-c172b6dded4f92f47f035b724605ecbb0e19970c.tar.gz emacs-c172b6dded4f92f47f035b724605ecbb0e19970c.zip | |
Stop monitoring fds after receiving EOF
When a subprocess closes its stdout/stderr pipe, that causes
pselect to always indicate that fd is readable, and read to
always return with EOF on that fd. Therefore when we receive an
EOF we need to stop monitoring the fd. Otherwise Emacs will
spin at 100% CPU, repeatedly reading that same EOF off the fd.
* src/process.c (wait_reading_process_output): When
'read_process_output' returns EOF indication, stop monitoring
the descriptor. (Bug#79436)
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index 82b8829ba8c..bd128311033 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -6054,7 +6054,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6054 | process gone just because its pipe is closed. */ | 6054 | process gone just because its pipe is closed. */ |
| 6055 | else if (nread == 0 && !NETCONN_P (proc) && !SERIALCONN_P (proc) | 6055 | else if (nread == 0 && !NETCONN_P (proc) && !SERIALCONN_P (proc) |
| 6056 | && !PIPECONN_P (proc)) | 6056 | && !PIPECONN_P (proc)) |
| 6057 | ; | 6057 | delete_read_fd (channel); |
| 6058 | else if (nread == 0 && PIPECONN_P (proc)) | 6058 | else if (nread == 0 && PIPECONN_P (proc)) |
| 6059 | { | 6059 | { |
| 6060 | /* Preserve status of processes already terminated. */ | 6060 | /* Preserve status of processes already terminated. */ |