diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2002-10-19 10:18:29 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2002-10-19 10:18:29 +0000 |
commit | d1cf9ea2c4d424f77e8ed5efa5a8c3a2b1db219d (patch) | |
tree | eb76b8b78adf2027e2a011436c20f37be602a2cf /usr.bin/ldd/ldd.c | |
parent | be23b71211eae43b2f4bbddb9213ea0cb3d0d083 (diff) | |
download | src-d1cf9ea2c4d424f77e8ed5efa5a8c3a2b1db219d.tar.gz src-d1cf9ea2c4d424f77e8ed5efa5a8c3a2b1db219d.zip |
Fix a problem with RTLD_TRACE flag to dlopen(3), which sometimes can return
even if there was no error occured (when trying to dlopen(3) object that
already linked into executable which does dlopen(3) call). This is more
proper fix for `ldd /usr/lib/libc.so' problem, because the new behaviour
conforms to documentation.
Remove workaround from ldd.c (rev.1.32).
PR: 35099
Submitted by: Nathan Hawkins <utsl@quic.net>
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=105439
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 68f99887d298..8e5e5d2f2bcf 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); } |