From e1317c149c7703b51d2e5d62c4d5891d99e57421 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 4 Mar 2013 07:31:57 -0800 Subject: wrappercheck.sh: more resilient against race conditions Killing the helper shell may fail when the shell already quit. --- test/wrappercheck.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/wrappercheck.sh b/test/wrappercheck.sh index dd7132c6..6c3eff75 100755 --- a/test/wrappercheck.sh +++ b/test/wrappercheck.sh @@ -60,8 +60,14 @@ kill -INT $BACKGROUND_PID && kill -TERM $BACKGROUND_PID || true KILL_PID=$! set +e wait $BACKGROUND_PID -kill -KILL $KILL_PID +msg=$(kill -KILL $KILL_PID 2>&1) SUBRET=$? +if echo "$msg" | grep -q 'No such process'; then + # Consider this a success. + SUBRET=0 +else + echo "$msg" +fi set -e if [ $RET = 0 ]; then RET=$SUBRET -- cgit v1.2.3