aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec_unix.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2024-02-23 13:07:11 -0500
committerGopher Robot <gobot@golang.org>2024-02-23 18:29:45 +0000
commitc4e4afc90eb6fd31710edb062bacfae0643d170f (patch)
treeba56fac577dc433b9504fe68912ea526ef7055cb /src/os/exec_unix.go
parent0e7c9846c430c2952e51ba7b1085fae9bec26f81 (diff)
downloadgo-c4e4afc90eb6fd31710edb062bacfae0643d170f.tar.xz
Revert "os: make FindProcess use pidfd on Linux"
This reverts CL 542699. Reason for revert: Some applications assume FindProcess does not return errors. For #62654. Fixes #65866. Change-Id: Ic185a6253c8e508b08150b618c39a9905f6cdd60 Reviewed-on: https://go-review.googlesource.com/c/go/+/566476 Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/os/exec_unix.go')
-rw-r--r--src/os/exec_unix.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/os/exec_unix.go b/src/os/exec_unix.go
index 21d03da48e..2c66a8be20 100644
--- a/src/os/exec_unix.go
+++ b/src/os/exec_unix.go
@@ -106,14 +106,8 @@ func (p *Process) release() error {
}
func findProcess(pid int) (p *Process, err error) {
- h, err := pidfdFind(pid)
- if err == ErrProcessDone {
- return nil, err
- }
- // Ignore all other errors from pidfdFind,
- // as the callers do not expect them, and
- // we can use pid anyway.
- return newProcess(pid, h), nil
+ // NOOP for unix.
+ return newProcess(pid, unsetHandle), nil
}
func (p *ProcessState) userTime() time.Duration {