diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-10-21 01:36:14 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-10-23 12:47:28 -0700 |
commit | 826ec178b4be3c5da281433cb1d296287980fbd1 (patch) | |
tree | 52fb6ff83f743529c20d9f9014607f570984ec75 /src/image.lisp | |
parent | f3bb959c9baba18a3575db969eaa4eecf5a9a21a (diff) | |
download | consfigurator-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.lisp | 30 |
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 () |