From d268ab32e3136534e8a1dd7e53eafd3583aea15a Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 13 Apr 2015 17:15:12 +0200 Subject: crossgcc: close stdin when search_tool() execute programs. bzip2 --version |grep -c will wait for input on stdin. ./buildgcc will hang because of this. Add `cat /dev/null |` close the stdin. Change-Id: I2a8b08a4d90ca7a89705923d5b68ba6ac13f29b3 Signed-off-by: Alexander Couzens Reviewed-on: http://review.coreboot.org/9605 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/crossgcc/buildgcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/crossgcc/buildgcc') diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 8bcaf2f26a..5a15e6d9fa 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -108,7 +108,7 @@ searchtool() fi for i in "$1" "g$1" "gnu$1"; do if test -x "`which $i 2>/dev/null`"; then - if test `$i --version 2>&1 |grep -c "$search"` \ + if test `cat /dev/null | $i --version 2>&1 |grep -c "$search"` \ -gt 0; then echo $i return -- cgit v1.2.3