From 3548f9a01f12f691f32ea7f0279b7949650e69b7 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 20 Nov 2023 13:16:13 -0800 Subject: [PATCH] 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 Reviewed-by: Cherry Mui Auto-Submit: Michael Pratt Reviewed-by: Michael Pratt --- src/os/exec_unix.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/os/exec_unix.go b/src/os/exec_unix.go index f9063b4db4..36b320df18 100644 --- a/src/os/exec_unix.go +++ b/src/os/exec_unix.go @@ -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, -- 2.50.0