Commit 57d77aee059b2a18319f8ab9e64247b78d846bef

Thomas de Grivel 2018-07-03T11:22:13

do not disconnect localhost

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/core/host.lisp b/core/host.lisp
index 4457254..dd98597 100644
--- a/core/host.lisp
+++ b/core/host.lisp
@@ -101,7 +101,8 @@
   (let ((g!host (gensym "HOST-")))
     `(let ((,g!host (make-instance 'host :id ,hostname)))
        (unwind-protect (let ((,var ,g!host)) ,@body)
-         (host-disconnect ,g!host)))))
+         (unless (eq (localhost) ,g!host)
+           (host-disconnect ,g!host))))))
 
 (defmethod host-run ((hostname string) &rest command)
   (with-connected-host (host hostname)