summaryrefslogtreecommitdiff
path: root/guix/ssh.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-08-28 18:51:12 +0200
committerLudovic Courtès <ludo@gnu.org>2019-08-28 18:52:52 +0200
commite09c7f4ae4e1c634975874cc18fd65ae4c4af091 (patch)
treea8b602e349554ad884aa372cc99837bd5b23de69 /guix/ssh.scm
parent2a5f781e76e2dbacf5b828e7e73a8d9f60e79b60 (diff)
remote, ssh: Show the command exit status upon failure.
* guix/remote.scm (remote-pipe-for-gexp): Show the exit status in error message. * guix/ssh.scm (remote-inferior): Likewise.
Diffstat (limited to 'guix/ssh.scm')
-rw-r--r--guix/ssh.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/guix/ssh.scm b/guix/ssh.scm
index 7bc499a2fe..b6b55bdfcb 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -106,14 +106,14 @@ given, use that to invoke the remote Guile REPL."
(let* ((repl-command (append (or become-command '())
'("guix" "repl" "-t" "machine")))
(pipe (apply open-remote-pipe* session OPEN_BOTH repl-command)))
- ;; XXX: 'channel-get-exit-status' would be better here, but hangs if the
- ;; process does succeed. This doesn't reflect the documentation, so it's
- ;; possible that it's a bug in guile-ssh.
(when (eof-object? (peek-char pipe))
- (raise (condition
- (&message
- (message (format #f (G_ "failed to run '~{~a~^ ~}'")
- repl-command))))))
+ (let ((status (channel-get-exit-status pipe)))
+ (close-port pipe)
+ (raise (condition
+ (&message
+ (message (format #f (G_ "remote command '~{~a~^ ~}' failed \
+with status ~a")
+ repl-command status)))))))
(port->inferior pipe)))
(define* (inferior-remote-eval exp session #:optional become-command)