aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-adb.el8
-rw-r--r--lisp/net/tramp-sh.el8
-rw-r--r--lisp/net/tramp.el17
3 files changed, 27 insertions, 6 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 7ef07afb8ef..b4a080ee0f6 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -918,9 +918,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
918 (kill-buffer (tramp-get-connection-buffer v)) 918 (kill-buffer (tramp-get-connection-buffer v))
919 (setq ret 1))) 919 (setq ret 1)))
920 920
921 ;; Handle signals. 921 ;; Handle signals. `process-file-return-signal-string' exists
922 (when (and (natnump ret) (> ret 128)) 922 ;; since Emacs 28.1.
923 (setq ret (format "Signal %d" (- ret 128)))) 923 (when (and (bound-and-true-p process-file-return-signal-string)
924 (natnump ret) (> ret 128))
925 (setq ret (nth (- ret 128) (tramp-get-signal-strings))))
924 926
925 ;; Provide error file. 927 ;; Provide error file.
926 (when tmpstderr (rename-file tmpstderr (cadr destination) t)) 928 (when tmpstderr (rename-file tmpstderr (cadr destination) t))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index c609f58cdd8..523663cafbd 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3159,9 +3159,11 @@ STDERR can also be a file name."
3159 (kill-buffer (tramp-get-connection-buffer v)) 3159 (kill-buffer (tramp-get-connection-buffer v))
3160 (setq ret 1))) 3160 (setq ret 1)))
3161 3161
3162 ;; Handle signals. 3162 ;; Handle signals. `process-file-return-signal-string' exists
3163 (when (and (natnump ret) (> ret 128)) 3163 ;; since Emacs 28.1.
3164 (setq ret (format "Signal %d" (- ret 128)))) 3164 (when (and (bound-and-true-p process-file-return-signal-string)
3165 (natnump ret) (>= ret 128))
3166 (setq ret (nth (- ret 128) (tramp-get-signal-strings))))
3165 3167
3166 ;; Provide error file. 3168 ;; Provide error file.
3167 (when tmpstderr (rename-file tmpstderr (cadr destination) t)) 3169 (when tmpstderr (rename-file tmpstderr (cadr destination) t))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 70fb46bb4cb..ee263ebe933 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5047,6 +5047,23 @@ name of a process or buffer, or nil to default to the current buffer."
5047 (lambda () 5047 (lambda ()
5048 (remove-hook 'interrupt-process-functions #'tramp-interrupt-process)))) 5048 (remove-hook 'interrupt-process-functions #'tramp-interrupt-process))))
5049 5049
5050(defun tramp-get-signal-strings ()
5051 "Strings to return by `process-file' in case of signals."
5052 ;; We use key nil for local connection properties.
5053 (with-tramp-connection-property nil "signal-strings"
5054 (let (result)
5055 (if (and (stringp shell-file-name) (executable-find shell-file-name))
5056 (dotimes (i 128)
5057 (push
5058 (if (= i 19) 1 ;; SIGSTOP
5059 (call-process
5060 shell-file-name nil nil nil "-c" (format "kill -%d $$" i)))
5061 result))
5062 (dotimes (i 128)
5063 (push (format "Signal %d" i) result)))
5064 ;; Due to Bug#41287, we cannot add this to the `dotimes' clause.
5065 (reverse result))))
5066
5050;; Checklist for `tramp-unload-hook' 5067;; Checklist for `tramp-unload-hook'
5051;; - Unload all `tramp-*' packages 5068;; - Unload all `tramp-*' packages
5052;; - Reset `file-name-handler-alist' 5069;; - Reset `file-name-handler-alist'