]> Cypherpunks repositories - gostls13.git/commitdiff
os: fix WNOHANG Waitmsg
authorGustavo Niemeyer <gustavo@niemeyer.net>
Mon, 29 Aug 2011 14:45:37 +0000 (10:45 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 29 Aug 2011 14:45:37 +0000 (10:45 -0400)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4962042

src/pkg/os/exec_unix.go

index 8a4b2e1b8060913a30b00abd7633ff0d5d92d453..41e77230ad5a466a6c5da08a03bba3a3db7d881e 100644 (file)
@@ -38,7 +38,8 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) {
        if e != 0 {
                return nil, NewSyscallError("wait", e)
        }
-       if options&WSTOPPED == 0 {
+       // With WNOHANG pid is 0 if child has not exited.
+       if pid1 != 0 && options&WSTOPPED == 0 {
                p.done = true
        }
        w = new(Waitmsg)