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.
This commit is contained in:
Ludovic Courtès 2018-11-24 19:38:55 +01:00
parent bb640d6133
commit 63fd9f084a
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 4 additions and 2 deletions

View File

@ -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 . _)