aboutsummaryrefslogtreecommitdiffhomepage
path: root/ldd/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'ldd/exec.go')
-rw-r--r--ldd/exec.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ldd/exec.go b/ldd/exec.go
index d91cd652..959a3f43 100644
--- a/ldd/exec.go
+++ b/ldd/exec.go
@@ -68,6 +68,11 @@ func Exec(ctx context.Context, msg message.Msg, p string) ([]*Entry, error) {
}
entries, decodeErr := d.Decode()
+ if decodeErr != nil {
+ // do not cancel on successful decode to avoid racing with ldd(1) termination
+ cancel()
+ }
+
if err := z.Wait(); err != nil {
m := stderr.Bytes()
if bytes.Contains(m, []byte(msgStaticSuffix)) || bytes.Contains(m, []byte(msgStaticGlibc)) {