mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 14:16:55 -05:00
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. Partially-Fixes: https://issues.guix.gnu.org/57827
This commit is contained in:
parent
0f46d4f147
commit
ad5584bf25
1 changed files with 8 additions and 1 deletions
|
@ -198,7 +198,14 @@ (define* (wait-for-file file marionette
|
|||
(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)))
|
||||
|
|
Loading…
Reference in a new issue