]> Cypherpunks repositories - gostls13.git/commitdiff
os: remove useless if from Wait on unix
authorKir Kolyshkin <kolyshkin@gmail.com>
Mon, 20 Nov 2023 21:16:13 +0000 (13:16 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 21 Nov 2023 20:39:17 +0000 (20:39 +0000)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/os/exec_unix.go

index f9063b4db455783bde808556dc8d94ff368e1d3f..36b320df1894d6481ec5bfb0c6b984d61af7cf1e 100644 (file)
@@ -48,9 +48,7 @@ func (p *Process) wait() (ps *ProcessState, err error) {
        if e != nil {
                return nil, NewSyscallError("wait", e)
        }
-       if pid1 != 0 {
-               p.setDone()
-       }
+       p.setDone()
        ps = &ProcessState{
                pid:    pid1,
                status: status,