diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-02-28 20:42:33 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-02-28 20:44:44 +0900 |
| commit | c74c269b66770f0eddde255d2805b79f274409e9 (patch) | |
| tree | 02cb3e1bed01d24776d8d47a9c8fca47ed3d7343 /container/container_test.go | |
| parent | 4b0cce4db5f8e75c79e104f8c5ec02cb4541ed76 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'container/container_test.go')
| -rw-r--r-- | container/container_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
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) |
