Skip to content

Commit 3548f9a

Browse files
kolyshkingopherbot
authored andcommitted
os: remove useless if from Wait on unix
Back in the day, Wait used to accept options argument. CL 4962042 fixed the issue of setting process.done flag when WNOHANG option was used. Later, CL 5688046 removed options argument from Wait, but did not remove pid1 != 0 check which was meant to be used with WNOHANG only. Remove the check, which is useless and also confusing. Change-Id: I73b9ef4a0dbe35466e659ca58b896d515ba86d02 Reviewed-on: https://go-review.googlesource.com/c/go/+/543736 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Auto-Submit: Michael Pratt <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 00715d0 commit 3548f9a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/os/exec_unix.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ func (p *Process) wait() (ps *ProcessState, err error) {
4848
if e != nil {
4949
return nil, NewSyscallError("wait", e)
5050
}
51-
if pid1 != 0 {
52-
p.setDone()
53-
}
51+
p.setDone()
5452
ps = &ProcessState{
5553
pid: pid1,
5654
status: status,

0 commit comments

Comments
 (0)