aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2012-02-22 11:48:41 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2012-02-22 11:48:41 -0800
commit0427c583a5877223447ec73b740b97fc39b12894 (patch)
tree14bc302ea3233232a40438ed48c4c3b49030b2f9
parent8b7cdb7f25ff1e97150ee4648ff4f7764454ccd5 (diff)
downloadgo-0427c583a5877223447ec73b740b97fc39b12894.tar.gz
go-0427c583a5877223447ec73b740b97fc39b12894.zip
builder: update for os.Wait changes.
This compiles again. R=golang-dev, minux.ma, rsc CC=golang-dev https://golang.org/cl/5687078
-rw-r--r--misc/dashboard/builder/exec.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/misc/dashboard/builder/exec.go b/misc/dashboard/builder/exec.go
index a500d234b9..802d5f079f 100644
--- a/misc/dashboard/builder/exec.go
+++ b/misc/dashboard/builder/exec.go
@@ -28,7 +28,7 @@ func run(envv []string, dir string, argv ...string) error {
// as well as writing it to logfile (if specified). It returns
// process combined stdout and stderr output, exit status and error.
// The error returned is nil, if process is started successfully,
-// even if exit status is not 0.
+// even if exit status is not successful.
func runLog(envv []string, logfile, dir string, argv ...string) (string, int, error) {
if *verbose {
log.Println("runLog", argv)
@@ -51,11 +51,13 @@ func runLog(envv []string, logfile, dir string, argv ...string) (string, int, er
cmd.Stdout = w
cmd.Stderr = w
- err := cmd.Run()
- if err != nil {
- if ws, ok := err.(*exec.ExitError); ok {
- return b.String(), ws.ExitStatus(), nil
- }
+ startErr := cmd.Start()
+ if startErr != nil {
+ return "", 1, startErr
+ }
+ exitStatus := 0
+ if err := cmd.Wait(); err != nil {
+ exitStatus = 1 // TODO(bradfitz): this is fake. no callers care, so just return a bool instead.
}
- return b.String(), 0, err
+ return b.String(), exitStatus, nil
}