summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2020-02-13 16:34:07 +0100
committerMichael Albinus <michael.albinus@gmx.de>2020-02-13 16:34:07 +0100
commit7fda39419296cda9ae1c01c8ca69a30775db68b0 (patch)
tree1026d657385abb6ab76e634c8d21a3484e01cc12 /lisp
parentde1d150a6ef58760ab0a58dbee84596623d85d14 (diff)
downloademacs-7fda39419296cda9ae1c01c8ca69a30775db68b0.tar.gz
emacs-7fda39419296cda9ae1c01c8ca69a30775db68b0.tar.bz2
emacs-7fda39419296cda9ae1c01c8ca69a30775db68b0.zip
Fix `tramp-interrupt-process'
* lisp/net/tramp.el (tramp-interrupt-process): Improve command. * test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name) (tramp-test26-file-name-completion): Simplify. (tramp-test31-interrupt-process): Remove :unstable tag.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6928df4fa60..409e1f7499a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5006,10 +5006,12 @@ name of a process or buffer, or nil to default to the current buffer."
(tramp-error proc 'error "Process %s is not active" proc)
(tramp-message proc 5 "Interrupt process %s with pid %s" proc pid)
;; This is for tramp-sh.el. Other backends do not support this (yet).
+ ;; Not all "kill" implementations support process groups by
+ ;; negative pid, so we try both variants.
(tramp-compat-funcall
'tramp-send-command
(process-get proc 'vector)
- (format "kill -2 -%d" pid))
+ (format "(\\kill -2 -%d || \\kill -2 %d) 2>/dev/null" pid pid))
;; Wait, until the process has disappeared. If it doesn't,
;; fall back to the default implementation.
(while (tramp-accept-process-output proc 0))
@@ -5064,10 +5066,5 @@ name of a process or buffer, or nil to default to the current buffer."
;; and friends, for most of the handlers this is the major
;; difference between the different backends. Other handlers but
;; *-process-file would profit from this as well.
-;;
-;; * Get rid of `shell-command'. In its primary implementation, it
-;; uses `process-file-shell-command' and
-;; `start-file-process-shell-command', which is sufficient due to
-;; connection-local `shell-file-name'.
;;; tramp.el ends here