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