From 936802f92a33a417da3b3633f91702980d7473d8 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 11 Jun 2020 20:58:24 +0200 Subject: [PATCH] Simplify exit status fix, restore interruptability The exit status fix introduced in cherry-picked commit 22c3a6e1 introduced a problem: interrupting the build only interrupted the main process, and the background job would happily continue. bin/package, src/cmd/INIT/package.sh: - Give up on the idea of a background job and put up with not cleaning up the FIFO. It's in a build directory that is going to get cleaned up anyway. --- bin/package | 6 +++--- src/cmd/INIT/package.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/package b/bin/package index 66a405df8..0fd1de35a 100755 --- a/bin/package +++ b/bin/package @@ -3969,6 +3969,8 @@ capture() # file command ... 0) if executable ! $TEE then TEE=tee fi + # Connect 'tee' to a FIFO instead of a pipe, so that the build is invoked from + # the main shell environment and its exit status can be used for $error_status rm -f $o.fifo mkfifo -m 600 $o.fifo || exit $TEE -a $o < $o.fifo & @@ -3978,9 +3980,7 @@ capture() # file command ... esac showenv $action "$@" - } > $o.fifo 2>&1 & - rm $o.fifo # unlink early - wait "$!" # get build's exit status + } < /dev/null > $o.fifo 2>&1 ;; *) { case $s in diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh index a934552eb..11b90f873 100644 --- a/src/cmd/INIT/package.sh +++ b/src/cmd/INIT/package.sh @@ -3968,6 +3968,8 @@ capture() # file command ... 0) if executable ! $TEE then TEE=tee fi + # Connect 'tee' to a FIFO instead of a pipe, so that the build is invoked from + # the main shell environment and its exit status can be used for $error_status rm -f $o.fifo mkfifo -m 600 $o.fifo || exit $TEE -a $o < $o.fifo & @@ -3977,9 +3979,7 @@ capture() # file command ... esac showenv $action "$@" - } > $o.fifo 2>&1 & - rm $o.fifo # unlink early - wait "$!" # get build's exit status + } < /dev/null > $o.fifo 2>&1 ;; *) { case $s in