From c74c269b66770f0eddde255d2805b79f274409e9 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 28 Feb 2026 20:42:33 +0900 Subject: container: use /proc/self/exe directly This is a more reliable form of pathname to self and also cheaper than os.Executable. Signed-off-by: Ophestra --- container/container_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'container/container_test.go') diff --git a/container/container_test.go b/container/container_test.go index 852304e7..e00a63c7 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -773,14 +773,13 @@ func TestMain(m *testing.M) { func helperNewContainerLibPaths(ctx context.Context, libPaths *[]*check.Absolute, args ...string) (c *container.Container) { msg := message.New(nil) msg.SwapVerbose(testing.Verbose()) - executable := check.MustAbs(container.MustExecutable(msg)) c = container.NewCommand(ctx, msg, absHelperInnerPath, "helper", args...) c.Env = append(c.Env, envDoCheck+"=1") - c.Bind(executable, absHelperInnerPath, 0) + c.Bind(fhs.AbsProcSelfExe, absHelperInnerPath, 0) // in case test has cgo enabled - if entries, err := ldd.Resolve(ctx, msg, executable); err != nil { + if entries, err := ldd.Resolve(ctx, msg, nil); err != nil { log.Fatalf("ldd: %v", err) } else { *libPaths = ldd.Path(entries) -- cgit v1.3.1