[tor-commits] [oonib/master] Only kill it if we didn't already killitwithfire().
isis at torproject.org
isis at torproject.org
Sat May 4 16:10:28 UTC 2013
commit aae56483be0322b1f76412cdb6065d5b4500fb3d
Author: Isis Lovecruft <isis at torproject.org>
Date: Sun Apr 21 09:31:19 2013 +0000
Only kill it if we didn't already killitwithfire().
---
.travis.test.sh | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/.travis.test.sh b/.travis.test.sh
index 4ffe8d3..d7f5092 100755
--- a/.travis.test.sh
+++ b/.travis.test.sh
@@ -15,19 +15,21 @@ set -vx --
function killitwithfire () {
trap - ALRM
kill -ALRM $prog 2>/dev/null
- kill $! 2>/dev/null && exit 124
+ kill -9 $! 2>/dev/null && exit 0
}
function waitforit () {
trap "killitwithfire" ALRM
- sleep $1 & wait
+ sleep $1& wait
kill -ALRM $$
}
waitforit $1& prog=$! ; shift ;
trap "killitwithfire" ALRM INT
-"$@"& wait `cat oonib.pid`
+"$@"& wait $!
RET=$?
-kill -ALRM $prog
-wait $prog
+if [[ "$(ps -ef | awk -v pid=$prog '$2==pid{print}{}')" != "" ]]; then
+ kill -ALRM $prog
+ wait $prog
+fi
exit $RET
More information about the tor-commits
mailing list