offload: Bail out when failing to register a GC root on the build machine.

* guix/scripts/offload.scm (register-gc-root): Call 'leave' when
  'close-pipe' returns non-zero.
This commit is contained in:
Ludovic Courtès 2014-04-08 10:04:13 +02:00
parent 8a9d928f57
commit a4b42825a1
1 changed files with 6 additions and 1 deletions

View File

@ -317,7 +317,12 @@ hook."
(let ((pipe (remote-pipe machine OPEN_READ
`("guile" "-c" ,(object->string script)))))
(get-string-all pipe)
(close-pipe pipe)))
(let ((status (close-pipe pipe)))
(unless (zero? status)
;; Better be safe than sorry: if we ignore the error here, then FILE
;; may be GC'd just before we start using it.
(leave (_ "failed to register GC root for '~a' on '~a' (status: ~a)~%")
file machine status)))))
(define (remove-gc-root machine)
"Remove from MACHINE the GC root previously installed with