ldd: treat nil pathname as self
All checks were successful
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m35s
Test / Hakurei (push) Successful in 3m46s
Test / ShareFS (push) Successful in 3m51s
Test / Hpkg (push) Successful in 4m21s
Test / Sandbox (race detector) (push) Successful in 4m54s
Test / Hakurei (race detector) (push) Successful in 5m53s
Test / Flake checks (push) Successful in 1m46s
All checks were successful
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m35s
Test / Hakurei (push) Successful in 3m46s
Test / ShareFS (push) Successful in 3m51s
Test / Hpkg (push) Successful in 4m21s
Test / Sandbox (race detector) (push) Successful in 4m54s
Test / Hakurei (race detector) (push) Successful in 5m53s
Test / Flake checks (push) Successful in 1m46s
This is a helpful shortcut for examining a test program's ldd output. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
14
ldd/exec.go
14
ldd/exec.go
@@ -36,7 +36,19 @@ const (
|
||||
// [os.SyscallError] for fault creating the stdout pipe,
|
||||
// [container.StartError] for fault during either stage of container setup.
|
||||
// Otherwise, it passes through the return values of [Decoder.Decode].
|
||||
func Resolve(ctx context.Context, msg message.Msg, pathname *check.Absolute) ([]*Entry, error) {
|
||||
func Resolve(
|
||||
ctx context.Context,
|
||||
msg message.Msg,
|
||||
pathname *check.Absolute,
|
||||
) ([]*Entry, error) {
|
||||
if pathname == nil {
|
||||
if p, err := os.Executable(); err != nil {
|
||||
return nil, err
|
||||
} else if pathname, err = check.NewAbs(p); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
c, cancel := context.WithTimeout(ctx, lddTimeout)
|
||||
defer cancel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user