aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_unix.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2024-09-06 12:19:01 -0700
committerGopher Robot <gobot@golang.org>2024-09-10 22:35:31 +0000
commit8926ca9c5ec3ea0b51e413e87f737aeb1422ea48 (patch)
tree2000b0ed00d376c91303d4dfbd9563b9f82a4cc1 /src/syscall/exec_unix.go
parentcdca67185573ca94734249584afd6cd2d3d58a84 (diff)
downloadgo-8926ca9c5ec3ea0b51e413e87f737aeb1422ea48.tar.xz
syscall: on exec failure, close pidfd
Fixes #69284 Change-Id: I6350209302778ba5e44fa03d0b9e680d2b4ec192 Reviewed-on: https://go-review.googlesource.com/c/go/+/611495 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: roger peppe <rogpeppe@gmail.com> Reviewed-by: Tim King <taking@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/syscall/exec_unix.go')
-rw-r--r--src/syscall/exec_unix.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/syscall/exec_unix.go b/src/syscall/exec_unix.go
index 1b90aa7e72..4747fa0758 100644
--- a/src/syscall/exec_unix.go
+++ b/src/syscall/exec_unix.go
@@ -237,6 +237,10 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
for err1 == EINTR {
_, err1 = Wait4(pid, &wstatus, 0, nil)
}
+
+ // OS-specific cleanup on failure.
+ forkAndExecFailureCleanup(attr, sys)
+
return 0, err
}