Skip to content

Commit

Permalink
libgo/testsuite: don't call kill without args
Browse files Browse the repository at this point in the history
If the timeout subshell has no child processes,
the "xargs | kill" will fail. Ensure there is
some input for kill before calling it.

Change-Id: Ifd2cb1ddf6d25c70cfa1d36a2b0171ee6e0f1c72
Reviewed-on: https://go-review.googlesource.com/13295
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
axw authored and ianlancetaylor committed Aug 7, 2015
1 parent 6fb7c35 commit 5891a4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libgo/testsuite/gotest
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,10 @@ xno)
wait $pid
status=$?
if ! test -f gotest-timeout; then
ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" " | xargs kill -9
out=`ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" "`
if test "x$out" != "x"; then
kill -9 $out
fi
fi
else
if test "$trace" = "true"; then
Expand Down

0 comments on commit 5891a4c

Please sign in to comment.