guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/05: ssh: Make 'send-files' more robust.


From: guix-commits
Subject: 02/05: ssh: Make 'send-files' more robust.
Date: Sat, 24 Nov 2018 17:25:43 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 63fd9f084a5e345d2edaeaf5e8f435a3130f9edc
Author: Ludovic Courtès <address@hidden>
Date:   Sat Nov 24 19:38:55 2018 +0100

    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.
---
 guix/ssh.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/ssh.scm b/guix/ssh.scm
index 25ec829..104f4f5 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 . _)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]