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

From-SVN: r227037
This commit is contained in:
Ian Lance Taylor 2015-08-20 17:10:45 +00:00
parent 6992707b2a
commit f999c862ec
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
448d30b696461a39870d1b8beb1195e411300bfd ec34cfb0b148ff461df12c8f5270a06e2f438b7c
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.

View File

@ -504,6 +504,7 @@ xno)
fi fi
${GL} *.o ${GOLIBS} ${GL} *.o ${GOLIBS}
set +e
if test "$bench" = ""; then if test "$bench" = ""; then
if test "$trace" = "true"; then if test "$trace" = "true"; then
echo ./a.out -test.short -test.timeout=${timeout}s "$@" echo ./a.out -test.short -test.timeout=${timeout}s "$@"
@ -518,9 +519,11 @@ xno)
wait $pid wait $pid
status=$? status=$?
if ! test -f gotest-timeout; then if ! test -f gotest-timeout; then
out=`ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" "` sleeppid=`ps -o pid,ppid,cmd | grep " $alarmpid " | grep sleep | sed -e 's/ *\([0-9]*\) .*$/\1/'`
if test "x$out" != "x"; then kill $alarmpid
kill -9 $out wait $alarmpid
if test "$sleeppid" != ""; then
kill $sleeppid
fi fi
fi fi
else else