1
0
mirror of https://github.com/golang/go synced 2024-11-25 08:57:58 -07:00

goinstall: check for error from exec.*Cmd.Wait() before using its result

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1923043
This commit is contained in:
Alex Brainman 2010-08-04 17:18:57 -07:00 committed by Russ Cox
parent 6b8ec5c572
commit 12576f9e70

View File

@ -207,6 +207,9 @@ func genRun(dir string, stdin []byte, cmd []string, quiet bool) os.Error {
io.Copy(&buf, p.Stdout)
w, err := p.Wait(0)
p.Close()
if err != nil {
return err
}
if !w.Exited() || w.ExitStatus() != 0 {
if !quiet || *verbose {
if dir != "" {