diff options
Diffstat (limited to 'libgo/go/os/exec_unix.go')
-rw-r--r-- | libgo/go/os/exec_unix.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/go/os/exec_unix.go b/libgo/go/os/exec_unix.go index 8a4b2e1b806..e1adb203e0a 100644 --- a/libgo/go/os/exec_unix.go +++ b/libgo/go/os/exec_unix.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build darwin freebsd linux openbsd + package os import ( @@ -38,7 +40,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) |