summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-24 19:38:55 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-24 19:52:16 +0100
commit63fd9f084a5e345d2edaeaf5e8f435a3130f9edc (patch)
treebbb9ce71935eb80ac809c0e74dbdcbc1c9b23f5f
parentbb640d6133dea0ede7e80db9ca64a9b2e451317a (diff)
downloadguix-63fd9f084a5e345d2edaeaf5e8f435a3130f9edc.tar.gz
ssh: Make 'send-files' more robust.
Possibly fixes <https://bugs.gnu.org/33239>.

* guix/ssh.scm (send-files): Call 'channel-get-exit-status' only when
RESULT is true.
-rw-r--r--guix/ssh.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/guix/ssh.scm b/guix/ssh.scm
index 25ec8295e8..104f4f52d6 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -297,9 +297,11 @@ Return the list of store items actually sent."
     (channel-send-eof port)
 
     ;; Wait for completion of the remote process and read the status sexp from
-    ;; PORT.
+    ;; PORT.  Wait for the exit status only when 'read' completed; otherwise,
+    ;; we might wait forever if the other end is stuck.
     (let* ((result (false-if-exception (read port)))
-           (status (zero? (channel-get-exit-status port))))
+           (status (and result
+                        (zero? (channel-get-exit-status port)))))
       (close-port port)
       (match result
         (('success . _)