From: brian Date: Wed, 2 Nov 2005 21:21:37 +0000 (+0000) Subject: Fix timed_run() so that it returns success when it's child does not time out. X-Git-Tag: v1_7_100~570 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=cee24dc969e8c97f59664c6fbb2a00f654cf5a34;hp=e726593675e7d958f199034245f0a055259655c5 Fix timed_run() so that it returns success when it's child does not time out. Bomb out of lmake if the update_oldconfig times out. --- diff --git a/build/lmake b/build/lmake index 34b03eb..78ce511 100755 --- a/build/lmake +++ b/build/lmake @@ -351,11 +351,18 @@ timed_run() { ("$@") & child_pid=$! - sleep $SLEEP_TIME + (sleep $SLEEP_TIME kill -TERM -$child_pid 2>/dev/null sleep 5 kill -KILL -$child_pid 2>/dev/null - echo "$1 was killed due to timeout" + echo "$1 was killed due to timeout") & + dog_pid=$! + + wait $child_pid + # status will be set to 143 if the process had to be killed due to timeout + status=$? + kill -KILL -$dog_pid + return $status } depend_kernel() @@ -375,6 +382,9 @@ depend_kernel() # new items conservatively. QA will get notified on anything newly added # for them to review and adjust accordingly. timed_run 300 $TOPDIR/build/update_oldconfig + if [ $? -eq 143 ]; then + fatal 1 "update_oldconfig timed out" + fi # now notify if resulting .config is different than $CONFIG_FILE local tmpfile=$(mktemp /tmp/XXXXXX) diff -I '^#.*' -u "$CONFIG_FILE" .config >$tmpfile