1
0
mirror of https://github.com/golang/go synced 2024-09-23 17:10:13 -06:00

handle compiler crash better:

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
This commit is contained in:
Russ Cox 2009-10-09 16:44:40 -07:00
parent c736b6579f
commit 7b5da358ca

View File

@ -30,7 +30,7 @@ close(SRC);
# Run command # Run command
$cmd = join(' ', @ARGV); $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>; @out = grep { !/^ / } <CMD>;
close CMD; close CMD;
@ -42,6 +42,7 @@ if($? == 0) {
if(!WIFEXITED($?)) { if(!WIFEXITED($?)) {
print STDERR "BUG: errchk: compiler crashed\n"; print STDERR "BUG: errchk: compiler crashed\n";
print STDERR @out, "\n";
exit 0; exit 0;
} }