diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2024-11-20 11:15:02 +0100 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-11-20 22:54:25 +0000 |
| commit | c94a9fdf651e44bed2fc72c783990a0eba63b24e (patch) | |
| tree | df3c9f5d7a1a8844c56eddae4448c1f0817dbe26 /src/os/exec_unix.go | |
| parent | dce30a19200d06b778fa90c96231b3cf71fe72d8 (diff) | |
| download | go-c94a9fdf651e44bed2fc72c783990a0eba63b24e.tar.xz | |
os: use ignoringEINTR2 in (*Process).pidWait
This was missed in CL 627479.
Change-Id: Ibcd511573c330bf782fe6a8a50d56bb70aedf3c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/629915
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/os/exec_unix.go')
| -rw-r--r-- | src/os/exec_unix.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/os/exec_unix.go b/src/os/exec_unix.go index ba6146ada1..34467ac7a0 100644 --- a/src/os/exec_unix.go +++ b/src/os/exec_unix.go @@ -63,17 +63,12 @@ func (p *Process) pidWait() (*ProcessState, error) { var ( status syscall.WaitStatus rusage syscall.Rusage - pid1 int - e error ) - for { - pid1, e = syscall.Wait4(p.Pid, &status, 0, &rusage) - if e != syscall.EINTR { - break - } - } - if e != nil { - return nil, NewSyscallError("wait", e) + pid1, err := ignoringEINTR2(func() (int, error) { + return syscall.Wait4(p.Pid, &status, 0, &rusage) + }) + if err != nil { + return nil, NewSyscallError("wait", err) } p.pidDeactivate(statusDone) return &ProcessState{ |
