[PATCH] xlat/gen.sh: prevent wait from failling upon PID reuse

Jules Maselbas jmaselbas at kalray.eu
Fri Aug 2 12:57:38 UTC 2019


In some case wait can fail if PID has been already taken by a new process.
As the return status is not used it might be better to always return true.

Reviewed-by: Yann Sionneau <ysionneau at kalray.eu>
Signed-off-by: Jules Maselbas <jmaselbas at kalray.eu>
---
 xlat/gen.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xlat/gen.sh b/xlat/gen.sh
index ceb0e8fd..d2dfdc8c 100755
--- a/xlat/gen.sh
+++ b/xlat/gen.sh
@@ -310,7 +310,7 @@ main()
 			if [ "${jobs}" -gt "$(( ncpus * 2 ))" ]; then
 				read wait_pid rest
 				pids="$rest"
-				wait -n 2>/dev/null || wait "$wait_pid"
+				wait -n 2>/dev/null || wait "$wait_pid" || true
 				: $(( jobs -= 1 ))
 			fi <<- EOF
 			$pids
-- 
2.21.0.196.g041f5ea



More information about the Strace-devel mailing list