summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-04-08 10:04:13 +0200
committerLudovic Courtès <ludo@gnu.org>2014-04-08 10:09:27 +0200
commita4b42825a198eb77baefea41b58a17f6504a729c (patch)
treed627e26d850e2ce0346eba8323b7608cc49b5b5d
parent8a9d928f57bd37bc2ff2742bee280962ffb9bc21 (diff)
downloadpatches-a4b42825a198eb77baefea41b58a17f6504a729c.tar
patches-a4b42825a198eb77baefea41b58a17f6504a729c.tar.gz
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.
-rw-r--r--guix/scripts/offload.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 1d86f99ca8..0761d68492 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -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