]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Store the PID in a variable to avoid $! being overwritten
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Jul 2024 17:40:11 +0000 (17:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Jul 2024 17:40:11 +0000 (17:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 1ebd89b1e81937a9fa1f294caa569d40e60fdde6..6e188f9947030a8310741151f9d9fb6122dcee4c 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -777,6 +777,8 @@ execute() {
        # Append the command
        execute+=( "${command[@]}" )
 
+       local pid
+
        # Return code
        local r=0
 
@@ -800,9 +802,12 @@ execute() {
                                "${execute[@]}" >> "${LOGFILE}" 2>&1 </dev/null
                        } &
 
+                       # Store the PID
+                       pid="$!"
+
                        # Wait for the process to complete
                        while :; do
-                               wait "$!"
+                               wait "${pid}"
 
                                # Store the return code
                                r="$?"