From: Michael Albinus Date: Mon, 18 Sep 2017 16:00:27 +0000 (+0200) Subject: Improve tramp-interrupt-process robustness X-Git-Tag: emacs-26.0.90~136 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e1b5bd92ce26291c71ddb33a6291225e6ec1152;p=emacs.git Improve tramp-interrupt-process robustness * lisp/net/tramp.el (tramp-interrupt-process): Wait, until the process has disappeared. --- 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))))