aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJim Porter2023-09-24 22:30:34 -0700
committerJim Porter2023-10-01 13:11:09 -0700
commit862e5effbf9b991af3fbbc8e31df33e64483c56f (patch)
treecf92ebb1ded1523c63e3c46dbcbeea87524d5673 /lisp
parent6b2219cd2744c711580cc7226554e69c8cec8247 (diff)
downloademacs-862e5effbf9b991af3fbbc8e31df33e64483c56f.tar.gz
emacs-862e5effbf9b991af3fbbc8e31df33e64483c56f.zip
; Adjust Eshell regression tests to avoid SIGPIPE
In batch mode, SIGPIPEs can cause Emacs to abort (bug#66186). * lisp/eshell/esh-io.el (eshell-output-object-to-target): Update comment. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/pipeline-connection-type/middle) (esh-proc-test/pipeline-connection-type/last): Use '(ignore)', since that causes no output when called with no arguments, thus avoiding a risky 'process-send-string'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/eshell/esh-io.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index cd0cee6e21d..d0f1e04e925 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -648,8 +648,11 @@ Returns what was actually sent, or nil if nothing was sent.")
648 (process-send-string target object) 648 (process-send-string target object)
649 (error 649 (error
650 ;; If `process-send-string' raises an error and the process has 650 ;; If `process-send-string' raises an error and the process has
651 ;; finished, treat it as a broken pipe. Otherwise, just 651 ;; finished, treat it as a broken pipe. Otherwise, just re-raise
652 ;; re-throw the signal. 652 ;; the signal. NOTE: When running Emacs in batch mode
653 ;; (e.g. during regression tests), Emacs can abort due to SIGPIPE
654 ;; here. Maybe `process-send-string' should handle SIGPIPE even
655 ;; in batch mode (bug#66186).
653 (if (process-live-p target) 656 (if (process-live-p target)
654 (signal (car err) (cdr err)) 657 (signal (car err) (cdr err))
655 (signal 'eshell-pipe-broken (list target))))) 658 (signal 'eshell-pipe-broken (list target)))))