libgo/testsuite: don't call kill without args
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 7 Aug 2015 10:10:00 +0000 (10:10 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 7 Aug 2015 10:10:00 +0000 (10:10 +0000)
    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

From-SVN: r226719

gcc/go/gofrontend/MERGE
libgo/testsuite/gotest

index 99e7aef67a2f70b9ac34ab208dc94e9871d16ded..a5b77a452f8278414ffacd50e0a389663f8f4aa5 100644 (file)
@@ -1,4 +1,4 @@
-6fb7c3509a4eda7d2403900981b53029d6727037
+5891a4c0615f469edcefc6d7a85a88984ba940aa
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 7d5e99f49874528a70c15ded5f43fbcd47aeb407..b2ee3ec248dd20ae847da406c4c4195478b36acb 100755 (executable)
@@ -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