summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2025-08-15 13:44:03 -0700
committerJim Porter <jporterbugs@gmail.com>2026-05-17 17:24:10 -0700
commite381cf1fc97fc1c0bab1816476dd6f73a628b238 (patch)
tree8a970428ed6b7ea846238ff83b3b7bddd315041f /etc
parenta557bf69b49ada1e777f9f031e975ce15ccbc2e7 (diff)
Allow child processes to continue after EPIPE
This ensures that if the child process closed its stdin and Emacs tries to write to it, the process can still do any remaining work and exit normally. In practice, this can occur with commands like "head(1)" (bug#79079). * src/fileio.c (file_for_stream): New function, extracted from... (Fset_binary_mode): ... here. (Ffile__close_stream): New function. * src/process.c (send_process): When encountering EPIPE, only close the fd for the pipe to the child process's stdin. * lisp/eshell/esh-io.el (eshell-output-object-to-target): Don't check for process liveness anymore. * test/src/process-tests.el (process-tests/broken-pipe): New function. (process-tests/broken-pipe/pipe, process-tests/broken-pipe/pty) (process-tests/broken-pipe/pipe-stdin) (process-tests/broken-pipe/pty-stdin): New tests. * etc/NEWS: Announce this change.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 795ac6f5c3d..e6fd8a7f747 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -30,6 +30,13 @@ applies, and please also update docstrings as needed.
* Changes in Emacs 32.1
+---
+** Emacs no longer kills child processes after EPIPE.
+Previously, Emacs would immediately kill a child process and set its
+exit status to 256 if sending input to that process returned EPIPE.
+Now when this happens, Emacs closes the file descriptor to write to the
+child process, but allows it to continue execution as normal.
+
* Editing Changes in Emacs 32.1