summaryrefslogtreecommitdiff
path: root/lisp/jsonrpc.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2018-08-12 13:22:27 +0100
committerJoão Távora <joaotavora@gmail.com>2018-08-12 13:25:05 +0100
commita5cd6cb2b55a40e3f72e5354d87b3290708f60bf (patch)
tree70e9cb141d1e5e9a09da83917b193dc9aa8c435e /lisp/jsonrpc.el
parenta04829d1b498fd63c534acae629580822ec66a7a (diff)
downloademacs-a5cd6cb2b55a40e3f72e5354d87b3290708f60bf.tar.gz
Revert "Make jsonrpc-shutdown a noop if process isn't running"
This reverts commit c580443325a3d071625185876a8f28e04793c625. It leads to situations where the sentinel hasn't run yet, which brings problems if the normal process isn't running, but the stderr pseudo-process still is. * lisp/jsonrpc.el (jsonrpc-shutdown): Always enter loop.
Diffstat (limited to 'lisp/jsonrpc.el')
-rw-r--r--lisp/jsonrpc.el26
1 files changed, 12 insertions, 14 deletions
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 43b570cfd92..3d88bbf67c9 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -417,21 +417,19 @@ connection object, called when the process dies .")
(cl-defmethod jsonrpc-shutdown ((conn jsonrpc-process-connection)
&optional cleanup)
- "Wait for JSONRPC connection CONN to shutdown and return t.
-If the server wasn't running, do nothing and return nil. With
-optional CLEANUP, kill any associated buffers. "
+ "Wait for JSONRPC connection CONN to shutdown.
+With optional CLEANUP, kill any associated buffers. "
(unwind-protect
- (when (jsonrpc-running-p conn)
- (cl-loop
- with proc = (jsonrpc--process conn)
- do
- (delete-process proc)
- (accept-process-output nil 0.1)
- while (not (process-get proc 'jsonrpc-sentinel-done))
- do (jsonrpc--warn
- "Sentinel for %s still hasn't run, deleting it!" proc)
- finally return t))
- (when cleanup (kill-buffer (process-buffer (jsonrpc--process conn))))))
+ (cl-loop
+ with proc = (jsonrpc--process conn)
+ do
+ (delete-process proc)
+ (accept-process-output nil 0.1)
+ while (not (process-get proc 'jsonrpc-sentinel-done))
+ do (jsonrpc--warn
+ "Sentinel for %s still hasn't run, deleting it!" proc))
+ (when cleanup
+ (kill-buffer (process-buffer (jsonrpc--process conn))))))
(defun jsonrpc-stderr-buffer (conn)
"Get CONN's standard error buffer, if any."