summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-09-16 09:32:36 +0200
committerGuix Patches Tester <>2022-09-16 08:34:49 +0100
commitabb651cc1f430cbd2bf4c074e12114a9313fe2ad (patch)
tree577a9297d77649a081dc24489a5ebe57945587c3
parentdc95689c3ce7aeed0eccd823df53f1175246485a (diff)
downloadguix-patches-abb651cc1f430cbd2bf4c074e12114a9313fe2ad.tar
guix-patches-abb651cc1f430cbd2bf4c074e12114a9313fe2ad.tar.gz
marionette: Avoid read error when wait-for-file file is empty.
Since #<eof> can't be read. * gnu/build/marionette.scm (wait-for-file): Return "" if file is empty.
-rw-r--r--gnu/build/marionette.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index fd59a4c72f..5ebf783892 100644
--- a/gnu/build/marionette.scm
+++ b/gnu/build/marionette.scm
@@ -198,7 +198,14 @@ FILE has not shown up after TIMEOUT seconds, raise an error."
(match (marionette-eval
`(let loop ((i ,timeout))
(cond ((file-exists? ,file)
- (cons 'success (call-with-input-file ,file ,read)))
+ (cons 'success
+ (let ((content
+ (call-with-input-file ,file ,read)))
+ (if (eof-object? content)
+ ;; #<eof> can't be read, so convert to the
+ ;; empty string
+ ""
+ content))))
((> i 0)
(sleep 1)
(loop (- i 1)))