Commit 1952eb50 authored by Gustavo Niemeyer's avatar Gustavo Niemeyer Committed by Russ Cox

os: fix WNOHANG Waitmsg

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4962042
parent 9ef17990
...@@ -38,7 +38,8 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) { ...@@ -38,7 +38,8 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) {
if e != 0 { if e != 0 {
return nil, NewSyscallError("wait", e) 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 p.done = true
} }
w = new(Waitmsg) w = new(Waitmsg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment