]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Correctly pass the command return code in run_command
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2024 08:36:39 +0000 (08:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2024 08:36:39 +0000 (08:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index be0b6480928be4aa2111792e26ef6f471cae90a8..c48a7e278d312267ba8659f56ea84c2905cb88b2 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -845,8 +845,11 @@ run_command() {
        while :; do
                wait "$!"
 
+               # Store the return code
+               r="$?"
+
                # If the return code is >= 128, wait has been interrupted by the timer
-               if [ "$?" -ge 128 ]; then
+               if [ "${r}" -ge 128 ]; then
                        # Update the runtime
                        case "${quiet}" in
                                false)
@@ -857,8 +860,6 @@ run_command() {
                        continue
                fi
 
-               # Store the return code
-               r="$?"
                break
        done