diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
commit | 4cecda6c347bd6902b960c6a35a967add7070b0d (patch) | |
tree | a462e224ff41ec9f3eb1a0b6e815806f9e8804ad /misc/dashboard/builder/exec.go | |
parent | 6c7ca6e4d4e26e4c8cbe0d183966011b3b088a0a (diff) | |
download | golang-4cecda6c347bd6902b960c6a35a967add7070b0d.tar.gz |
Imported Upstream version 2012.01.27upstream-weekly/2012.01.27
Diffstat (limited to 'misc/dashboard/builder/exec.go')
-rw-r--r-- | misc/dashboard/builder/exec.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/dashboard/builder/exec.go b/misc/dashboard/builder/exec.go index a042c5699..7f21abaa2 100644 --- a/misc/dashboard/builder/exec.go +++ b/misc/dashboard/builder/exec.go @@ -6,15 +6,15 @@ package main import ( "bytes" - "exec" "io" "log" "os" + "os/exec" "strings" ) // run is a simple wrapper for exec.Run/Close -func run(envv []string, dir string, argv ...string) os.Error { +func run(envv []string, dir string, argv ...string) error { if *verbose { log.Println("run", argv) } @@ -31,7 +31,7 @@ func run(envv []string, dir string, argv ...string) os.Error { // 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. -func runLog(envv []string, logfile, dir string, argv ...string) (string, int, os.Error) { +func runLog(envv []string, logfile, dir string, argv ...string) (string, int, error) { if *verbose { log.Println("runLog", argv) } @@ -56,11 +56,11 @@ func runLog(envv []string, logfile, dir string, argv ...string) (string, int, os err := cmd.Run() if err != nil { - if ws, ok := err.(*os.Waitmsg); ok { + if ws, ok := err.(*exec.ExitError); ok { return b.String(), ws.ExitStatus(), nil } } - return b.String(), 0, nil + return b.String(), 0, err } // useBash prefixes a list of args with 'bash' if the first argument |