aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/net/tramp.el9
-rw-r--r--test/lisp/net/tramp-tests.el18
2 files changed, 11 insertions, 16 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."
5006 (tramp-error proc 'error "Process %s is not active" proc) 5006 (tramp-error proc 'error "Process %s is not active" proc)
5007 (tramp-message proc 5 "Interrupt process %s with pid %s" proc pid) 5007 (tramp-message proc 5 "Interrupt process %s with pid %s" proc pid)
5008 ;; This is for tramp-sh.el. Other backends do not support this (yet). 5008 ;; This is for tramp-sh.el. Other backends do not support this (yet).
5009 ;; Not all "kill" implementations support process groups by
5010 ;; negative pid, so we try both variants.
5009 (tramp-compat-funcall 5011 (tramp-compat-funcall
5010 'tramp-send-command 5012 'tramp-send-command
5011 (process-get proc 'vector) 5013 (process-get proc 'vector)
5012 (format "kill -2 -%d" pid)) 5014 (format "(\\kill -2 -%d || \\kill -2 %d) 2>/dev/null" pid pid))
5013 ;; Wait, until the process has disappeared. If it doesn't, 5015 ;; Wait, until the process has disappeared. If it doesn't,
5014 ;; fall back to the default implementation. 5016 ;; fall back to the default implementation.
5015 (while (tramp-accept-process-output proc 0)) 5017 (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."
5064;; and friends, for most of the handlers this is the major 5066;; and friends, for most of the handlers this is the major
5065;; difference between the different backends. Other handlers but 5067;; difference between the different backends. Other handlers but
5066;; *-process-file would profit from this as well. 5068;; *-process-file would profit from this as well.
5067;;
5068;; * Get rid of `shell-command'. In its primary implementation, it
5069;; uses `process-file-shell-command' and
5070;; `start-file-process-shell-command', which is sufficient due to
5071;; connection-local `shell-file-name'.
5072 5069
5073;;; tramp.el ends here 5070;;; tramp.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index f70f324868d..3e192899d45 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2217,11 +2217,10 @@ This checks also `file-name-as-directory', `file-name-directory',
2217 2217
2218 ;; Bug#10085. 2218 ;; Bug#10085.
2219 (when (tramp--test-enabled) ;; Packages like tramp-gvfs.el might be disabled. 2219 (when (tramp--test-enabled) ;; Packages like tramp-gvfs.el might be disabled.
2220 (dolist (n-e '(nil t)) 2220 (dolist (non-essential '(nil t))
2221 ;; We must clear `tramp-default-method'. On hydra, it is "ftp", 2221 ;; We must clear `tramp-default-method'. On hydra, it is "ftp",
2222 ;; which ruins the tests. 2222 ;; which ruins the tests.
2223 (let ((non-essential n-e) 2223 (let ((tramp-default-method
2224 (tramp-default-method
2225 (file-remote-p tramp-test-temporary-file-directory 'method)) 2224 (file-remote-p tramp-test-temporary-file-directory 'method))
2226 (host (file-remote-p tramp-test-temporary-file-directory 'host))) 2225 (host (file-remote-p tramp-test-temporary-file-directory 'host)))
2227 (dolist 2226 (dolist
@@ -4035,10 +4034,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4035 ;; Cleanup. 4034 ;; Cleanup.
4036 (tramp-change-syntax orig-syntax)))) 4035 (tramp-change-syntax orig-syntax))))
4037 4036
4038 (dolist (n-e '(nil t)) 4037 (dolist (non-essential '(nil t))
4039 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 4038 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
4040 (let ((non-essential n-e) 4039 (let ((tmp-name (tramp--test-make-temp-name nil quoted)))
4041 (tmp-name (tramp--test-make-temp-name nil quoted)))
4042 4040
4043 (unwind-protect 4041 (unwind-protect
4044 (progn 4042 (progn
@@ -4419,9 +4417,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4419 4417
4420(ert-deftest tramp-test31-interrupt-process () 4418(ert-deftest tramp-test31-interrupt-process ()
4421 "Check `interrupt-process'." 4419 "Check `interrupt-process'."
4422 ;; The test fails from time to time, w/o a reproducible pattern. So 4420 :tags '(:expensive-test)
4423 ;; we mark it as unstable.
4424 :tags '(:expensive-test :unstable)
4425 (skip-unless (tramp--test-enabled)) 4421 (skip-unless (tramp--test-enabled))
4426 (skip-unless (tramp--test-sh-p)) 4422 (skip-unless (tramp--test-sh-p))
4427 ;; Since Emacs 26.1. 4423 ;; Since Emacs 26.1.
@@ -4435,7 +4431,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4435 kill-buffer-query-functions proc) 4431 kill-buffer-query-functions proc)
4436 (unwind-protect 4432 (unwind-protect
4437 (with-temp-buffer 4433 (with-temp-buffer
4438 (setq proc (start-file-process "test" (current-buffer) "sleep" "10")) 4434 (setq proc (start-file-process-shell-command
4435 "test" (current-buffer)
4436 "trap 'echo boom; exit 1' 2; sleep 100"))
4439 (should (processp proc)) 4437 (should (processp proc))
4440 (should (process-live-p proc)) 4438 (should (process-live-p proc))
4441 (should (equal (process-status proc) 'run)) 4439 (should (equal (process-status proc) 'run))