aboutsummaryrefslogtreecommitdiff
path: root/src/image.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-10-21 01:36:14 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-10-23 12:47:28 -0700
commit826ec178b4be3c5da281433cb1d296287980fbd1 (patch)
tree52fb6ff83f743529c20d9f9014607f570984ec75 /src/image.lisp
parentf3bb959c9baba18a3575db969eaa4eecf5a9a21a (diff)
downloadconsfigurator-826ec178b4be3c5da281433cb1d296287980fbd1.tar.gz
HANDLE-FORK-REQUEST: use return values of BT:JOIN-THREAD
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/image.lisp')
-rw-r--r--src/image.lisp30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/image.lisp b/src/image.lisp
index bde16a1..90bdab0 100644
--- a/src/image.lisp
+++ b/src/image.lisp
@@ -264,30 +264,26 @@ already running from FILENAME."
(eval-input)
(with-fork-control (eval-input)))))))
(unwind-protect
- (let* (outbuf
- (out-reader
- (bt:make-thread
- (lambda ()
- (setq outbuf
- (read-file-string out :element-type 'character)))))
- errbuf
- (err-reader
- (bt:make-thread
- (lambda ()
- (setq errbuf
- (read-file-string err :element-type 'character)))))
- (status (nth-value 1 (nix:waitpid child))))
+ (let ((out-reader
+ (bt:make-thread
+ (lambda ()
+ (read-file-string out :element-type 'character))))
+ (err-reader
+ (bt:make-thread
+ (lambda ()
+ (read-file-string err :element-type 'character))))
+ (status (nth-value 1 (nix:waitpid child))))
(unless (nix:WIFEXITED status)
(failed-change
"~&Grandchild process did not exit normally, status #x~(~4,'0X~)."
status))
- (bt:join-thread out-reader)
- (bt:join-thread err-reader)
(with-open-file (output output :direction :output
:if-exists :append
:element-type 'character)
- (write-to-mkfifo
- (list outbuf errbuf (nix:WEXITSTATUS status)) output)))
+ (write-to-mkfifo (list (bt:join-thread out-reader)
+ (bt:join-thread err-reader)
+ (nix:WEXITSTATUS status))
+ output)))
(delete-file out) (delete-file err))))
(defclass asdf-requirements ()