aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-20 17:10:45 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-20 17:10:45 +0000
commit274434054a510c809532aab8b03bc175c953eeea (patch)
tree3cb896116e0cb0ae2c812edd1574d6e976c35015 /libgo
parentf2e7ec4a444dd4c4455a766369759bee64d52dd5 (diff)
libgo/testsuite: another fix for killing the sleep process
Avoid ps padding issues. Make sure we locate and kill just the sleep process. Reviewed-on: https://go-review.googlesource.com/13634 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227037 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/testsuite/gotest9
1 files changed, 6 insertions, 3 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index b2ee3ec248d..79097b86bc6 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -504,6 +504,7 @@ xno)
fi
${GL} *.o ${GOLIBS}
+ set +e
if test "$bench" = ""; then
if test "$trace" = "true"; then
echo ./a.out -test.short -test.timeout=${timeout}s "$@"
@@ -518,9 +519,11 @@ xno)
wait $pid
status=$?
if ! test -f gotest-timeout; then
- out=`ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" "`
- if test "x$out" != "x"; then
- kill -9 $out
+ sleeppid=`ps -o pid,ppid,cmd | grep " $alarmpid " | grep sleep | sed -e 's/ *\([0-9]*\) .*$/\1/'`
+ kill $alarmpid
+ wait $alarmpid
+ if test "$sleeppid" != ""; then
+ kill $sleeppid
fi
fi
else