diff options
Diffstat (limited to 'src/pkg/os/exec_unix.go')
| -rw-r--r-- | src/pkg/os/exec_unix.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/os/exec_unix.go b/src/pkg/os/exec_unix.go index 8a4b2e1b8..41e77230a 100644 --- a/src/pkg/os/exec_unix.go +++ b/src/pkg/os/exec_unix.go @@ -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) |
