cmd/pprof: exit with non-zero status code on error

Set the status code in case of error.

Fixes #11510

Change-Id: If461c30a1f6d2275539f33a2eabd7b19bbfa411d
Reviewed-on: https://go-review.googlesource.com/16718
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Mohit Agarwal 2015-11-06 23:27:01 +05:30 committed by Russ Cox
parent 3fb9e08758
commit 08ab43eca2

View file

@ -27,6 +27,7 @@ func main() {
var extraCommands map[string]*commands.Command // no added Go-specific commands
if err := driver.PProf(flags{}, fetch.Fetcher, symbolize, new(objTool), plugin.StandardUI(), extraCommands); err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(2)
}
}