From 5e308b73d74b747ad614b297fbc4926402c754da Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 7 Aug 2015 10:10:00 +0000 Subject: libgo/testsuite: don't call kill without args If the timeout subshell has no child processes, the "xargs | kill" will fail. Ensure there is some input for kill before calling it. Reviewed-on: https://go-review.googlesource.com/13295 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226719 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/testsuite/gotest | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libgo') diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index 7d5e99f4987..b2ee3ec248d 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -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 -- cgit v1.2.1