aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-14 21:59:59 +0900
committerOphestra <cat@gensokyo.uk>2025-11-14 21:59:59 +0900
commit47244daefb80479c6e006b4e4687432ba6fc9608 (patch)
treeee4c977bf02fb094aee33332291d3fc8c8f2ad84
parent46fa1044195ed1e98f3b27cadbad4f8153f7977d (diff)
treewide: migrate ldd callers
This discontinues use of the deprecated ldd.Exec function for #25. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--container/container_test.go6
-rw-r--r--internal/system/dbus/proc.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/container/container_test.go b/container/container_test.go
index ecd3a1d7..d737a184 100644
--- a/container/container_test.go
+++ b/container/container_test.go
@@ -762,12 +762,14 @@ 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(check.MustAbs(os.Args[0]), absHelperInnerPath, 0)
+ c.Bind(executable, absHelperInnerPath, 0)
// in case test has cgo enabled
- if entries, err := ldd.Exec(ctx, msg, os.Args[0]); err != nil {
+ if entries, err := ldd.Resolve(ctx, msg, executable); err != nil {
log.Fatalf("ldd: %v", err)
} else {
*libPaths = ldd.Path(entries)
diff --git a/internal/system/dbus/proc.go b/internal/system/dbus/proc.go
index 0bd9c6b3..c934e89e 100644
--- a/internal/system/dbus/proc.go
+++ b/internal/system/dbus/proc.go
@@ -54,7 +54,7 @@ func (p *Proxy) Start() error {
}
var libPaths []*check.Absolute
- if entries, err := ldd.Exec(ctx, p.msg, toolPath.String()); err != nil {
+ if entries, err := ldd.Resolve(ctx, p.msg, toolPath); err != nil {
return err
} else {
libPaths = ldd.Path(entries)