Changes in directory llvm-test:
TimedExec.sh updated: 1.1 -> 1.2 --- Log message: The watchdog process should wakes up every sec to check if the parent has completed. --- Diffs of the changes: (+10 -4) TimedExec.sh | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) Index: llvm-test/TimedExec.sh diff -u llvm-test/TimedExec.sh:1.1 llvm-test/TimedExec.sh:1.2 --- llvm-test/TimedExec.sh:1.1 Wed Jun 7 13:57:36 2006 +++ llvm-test/TimedExec.sh Wed Jun 7 15:14:57 2006 @@ -24,14 +24,20 @@ if [ -z "$PARENT" ]; then # Start a watchdog process $0 -p $$ $TIMEOUT $PROGRAM $* & - WATCHDOG="$!" exec "$@" - # I am done first. kill the watch dog. - kill $WATCHDOG && (sleep 2; kill -1 $WATCHDOG) && (sleep 2; kill -9 $WATCHDOG) else # Sleep for a specified time then wake up to kill the parent process. exec > /dev/null 2>&1 - sleep $TIMEOUT + SEC=0 + while [ $SEC -lt $TIMEOUT ]; do + sleep 1 + # Check if parent has completed. + kill -s INFO $PATENT 2>/dev/null + if [ $? -eq 1 ]; then + exit 0 + fi + SEC=$(($SEC + 1)) + done kill $PARENT && (sleep 2; kill -1 $PARENT) && (sleep 2; kill -9 $PARENT) fi _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits