diff options
author | Roland Shoemaker <roland@golang.org> | 2021-01-19 15:52:45 -0800 |
---|---|---|
committer | Roland Shoemaker <roland@golang.org> | 2021-01-19 15:52:50 -0800 |
commit | c88ae12aee33bf5b7ddcd002fdf1ab77ee796c7e (patch) | |
tree | 1832f503e8fa852f1c88f602abe0c9600f11c783 /src/cmd/cgo/util.go | |
parent | 069f9d96d179becc61231d566c9a75f1ec26e991 (diff) | |
parent | 2117ea9737bc9cb2e30cb087b76a283f68768819 (diff) | |
download | go-c88ae12aee33bf5b7ddcd002fdf1ab77ee796c7e.tar.gz go-c88ae12aee33bf5b7ddcd002fdf1ab77ee796c7e.zip |
[release-branch.go1.15] all: merge release-branch.go1.15-security into release-branch.go1.15
Change-Id: I0b607475b3d767b712bfb3c9a350b32f3491517c
Diffstat (limited to 'src/cmd/cgo/util.go')
-rw-r--r-- | src/cmd/cgo/util.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/cgo/util.go b/src/cmd/cgo/util.go index 921306b7aa..00d931b98a 100644 --- a/src/cmd/cgo/util.go +++ b/src/cmd/cgo/util.go @@ -8,9 +8,9 @@ import ( "bytes" "fmt" "go/token" + exec "internal/execabs" "io/ioutil" "os" - "os/exec" ) // run runs the command argv, feeding in stdin on standard input. @@ -63,7 +63,7 @@ func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) { p.Env = append(os.Environ(), "TERM=dumb") err := p.Run() if _, ok := err.(*exec.ExitError); err != nil && !ok { - fatalf("%s", err) + fatalf("exec %s: %s", argv[0], err) } ok = p.ProcessState.Success() stdout, stderr = bout.Bytes(), berr.Bytes() @@ -88,7 +88,7 @@ func fatalf(msg string, args ...interface{}) { // If we've already printed other errors, they might have // caused the fatal condition. Assume they're enough. if nerrors == 0 { - fmt.Fprintf(os.Stderr, msg+"\n", args...) + fmt.Fprintf(os.Stderr, "cgo: "+msg+"\n", args...) } os.Exit(2) } |