]> Cypherpunks repositories - gostls13.git/commitdiff
handle compiler crash better:
authorRuss Cox <rsc@golang.org>
Fri, 9 Oct 2009 23:44:40 +0000 (16:44 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 9 Oct 2009 23:44:40 +0000 (16:44 -0700)
need to use exec to avoid seeing
shell output about the crash.

R=iant
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=35542
CL=35560

test/errchk

index 0625dbca101aa97ea81a13244686e86a87ee9f80..3aafddb82d4b6e4291d1bc17043cf9da1030cbe6 100755 (executable)
@@ -30,7 +30,7 @@ close(SRC);
 
 # Run command
 $cmd = join(' ', @ARGV);
-open(CMD, "$cmd </dev/null 2>&1 |") || die "BUG: errchk: run $cmd: $!";
+open(CMD, "exec $cmd </dev/null 2>&1 |") || die "BUG: errchk: run $cmd: $!";
 @out = grep { !/^      / } <CMD>;
 close CMD;
 
@@ -42,6 +42,7 @@ if($? == 0) {
 
 if(!WIFEXITED($?)) {
        print STDERR "BUG: errchk: compiler crashed\n";
+       print STDERR @out, "\n";
        exit 0;
 }