aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-09-18 18:00:27 +0200
committerMichael Albinus2017-09-18 18:00:27 +0200
commit9e1b5bd92ce26291c71ddb33a6291225e6ec1152 (patch)
treeee8fdfae05c812de569ee3b2b215ec5f02a4a6f7
parent8d4223e61b5e4661ececb6ab84c665fe761d0438 (diff)
downloademacs-9e1b5bd92ce26291c71ddb33a6291225e6ec1152.tar.gz
emacs-9e1b5bd92ce26291c71ddb33a6291225e6ec1152.zip
Improve tramp-interrupt-process robustness
* lisp/net/tramp.el (tramp-interrupt-process): Wait, until the process has disappeared.
-rw-r--r--lisp/net/tramp.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 07c06808bb2..abcd5282d3a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4556,6 +4556,12 @@ Only works for Bourne-like shells."
4556 'tramp-send-command 4556 'tramp-send-command
4557 (tramp-get-connection-property proc "vector" nil) 4557 (tramp-get-connection-property proc "vector" nil)
4558 (format "kill -2 %d" pid)) 4558 (format "kill -2 %d" pid))
4559 ;; Wait, until the process has disappeared.
4560 (with-timeout
4561 (1 (tramp-error proc 'error "Process %s did not interrupt" proc))
4562 (while (process-live-p proc)
4563 ;; We cannot run `tramp-accept-process-output', it blocks timers.
4564 (accept-process-output proc 0.1)))
4559 ;; Report success. 4565 ;; Report success.
4560 proc)))) 4566 proc))))
4561 4567