From 9e1b5bd92ce26291c71ddb33a6291225e6ec1152 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 18 Sep 2017 18:00:27 +0200 Subject: [PATCH] Improve tramp-interrupt-process robustness * lisp/net/tramp.el (tramp-interrupt-process): Wait, until the process has disappeared. --- lisp/net/tramp.el | 6 ++++++ 1 file changed, 6 insertions(+) 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." 'tramp-send-command (tramp-get-connection-property proc "vector" nil) (format "kill -2 %d" pid)) + ;; Wait, until the process has disappeared. + (with-timeout + (1 (tramp-error proc 'error "Process %s did not interrupt" proc)) + (while (process-live-p proc) + ;; We cannot run `tramp-accept-process-output', it blocks timers. + (accept-process-output proc 0.1))) ;; Report success. proc)))) -- 2.39.5