aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/os/exec/exec.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2012-02-10 14:52:08 +1100
committerBrad Fitzpatrick <bradfitz@golang.org>2012-02-10 14:52:08 +1100
commit5d198bf8661be6ad0659793eebaec0ab587eb876 (patch)
treecd399b9a46e694b0cf49786a5cb6b1c736bd0a96 /src/pkg/os/exec/exec.go
parent4c7695126d881b4622ed74238d7ce5c4e6b3b259 (diff)
downloadgo-5d198bf8661be6ad0659793eebaec0ab587eb876.tar.xz
os/exec: add Cmd.Waitmsg, fix a misleading comment
Fixes #2948 R=golang-dev, r CC=golang-dev https://golang.org/cl/5655048
Diffstat (limited to 'src/pkg/os/exec/exec.go')
-rw-r--r--src/pkg/os/exec/exec.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkg/os/exec/exec.go b/src/pkg/os/exec/exec.go
index a00fdad497..fe25467216 100644
--- a/src/pkg/os/exec/exec.go
+++ b/src/pkg/os/exec/exec.go
@@ -68,7 +68,7 @@ type Cmd struct {
// new process. It does not include standard input, standard output, or
// standard error. If non-nil, entry i becomes file descriptor 3+i.
//
- // BUG: on OS X 10.6, child processes may sometimes inherit extra fds.
+ // BUG: on OS X 10.6, child processes may sometimes inherit unwanted fds.
// http://golang.org/issue/2603
ExtraFiles []*os.File
@@ -79,6 +79,10 @@ type Cmd struct {
// Process is the underlying process, once started.
Process *os.Process
+ // Waitmsg contains information about an exited process,
+ // available after a call to Wait or Run.
+ Waitmsg *os.Waitmsg
+
err error // last error (from LookPath, stdin, stdout, stderr)
finished bool // when Wait was called
childFiles []*os.File
@@ -288,6 +292,7 @@ func (c *Cmd) Wait() error {
}
c.finished = true
msg, err := c.Process.Wait(0)
+ c.Waitmsg = msg
var copyError error
for _ = range c.goroutine {