[coreboot-gerrit] New patch to review for coreboot: 44275b3 crossgcc: close stdin when search_tool() execute programs.

Alexander Couzens (lynxis@fe80.eu) gerrit at coreboot.org
Mon Apr 13 17:23:08 CEST 2015


Alexander Couzens (lynxis at fe80.eu) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9605

-gerrit

commit 44275b350faca370fa1387ba5b23443393dabf36
Author: Alexander Couzens <lynxis at fe80.eu>
Date:   Mon Apr 13 17:15:12 2015 +0200

    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 <lynxis at fe80.eu>
---
 util/crossgcc/buildgcc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 8bcaf2f..5a15e6d 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



More information about the coreboot-gerrit mailing list