summaryrefslogtreecommitdiffstats
path: root/usr.bin/ldd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ldd')
-rw-r--r--usr.bin/ldd/ldd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c
index 8e5e5d2..68f9988 100644
--- a/usr.bin/ldd/ldd.c
+++ b/usr.bin/ldd/ldd.c
@@ -220,12 +220,13 @@ main(int argc, char *argv[])
}
break;
case 0:
- if (is_shlib == 0) {
+ if (is_shlib) {
+ if (dlopen(*argv, RTLD_TRACE))
+ _exit(0); /* libc.so */
+ warnx("%s: %s", *argv, dlerror());
+ } else {
execl(*argv, *argv, (char *)NULL);
warn("%s", *argv);
- } else {
- dlopen(*argv, RTLD_TRACE);
- warnx("%s: %s", *argv, dlerror());
}
_exit(1);
}
OpenPOWER on IntegriCloud