From c51d4b5b46890da0551b35d6975da7a04a53bc6d Mon Sep 17 00:00:00 2001 From: wlott <wlott> Date: Mon, 10 Sep 1990 00:21:26 +0000 Subject: [PATCH] Changed CREATE-SLAVE to check the status of the process while waiting for it to connect. If the process exits of is killed, report that instead of waiting for an arbitrary about of time. --- hemlock/eval-server.lisp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/hemlock/eval-server.lisp b/hemlock/eval-server.lisp index d88341c75..ba7c2698e 100644 --- a/hemlock/eval-server.lisp +++ b/hemlock/eval-server.lisp @@ -325,23 +325,30 @@ (when (getstring background *buffer-names*) (editor-error "Buffer ~A is already in use." background))) (message "Spawning slave ... ") - (unless (ext:run-program (namestring (truename (value slave-utility))) - `("-slave" ,(get-editor-name) - ,@(if slave (list "-slave-buffer" slave)) - ,@(if background - (list "-background-buffer" background)) - ,@(value slave-utility-switches)) - :wait nil - :output "/dev/null" - :if-output-exists :append) - (editor-error "Could not start slave.")) - (let ((*accept-connections* t) + (let ((proc + (ext:run-program (namestring (truename (value slave-utility))) + `("-slave" ,(get-editor-name) + ,@(if slave (list "-slave-buffer" slave)) + ,@(if background + (list "-background-buffer" background)) + ,@(value slave-utility-switches)) + :wait nil + :output "/dev/null" + :if-output-exists :append)) + (*accept-connections* t) (*newly-created-slave* nil)) + (unless proc + (editor-error "Could not start slave.")) (dotimes (i *slave-connect-wait* (editor-error "Client Lisp is still unconnected. ~ You must use \"Accept Slave Connections\" to ~ allow the slave to connect at this point.")) (system:serve-event 1) + (case (ext:process-status proc) + (:exited + (editor-error "The slave lisp exited before connecting.")) + (:signaled + (editor-error "The slave lisp was kill before connecting."))) (when *newly-created-slave* (message "DONE") (return *newly-created-slave*)))))) -- GitLab