summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-04-29 11:07:06 +0200
committerAndreas Schneider <asn@samba.org>2014-05-05 09:58:09 +0200
commiteb6676b6ed0f25a45fb3a7c04633aa83f378c23d (patch)
tree4503edb534ace1464ee31309daff930b597cff03 /src
parent7f4d72e11bcdfc47d4e4980349a0b0250352e6ca (diff)
downloadsocket_wrapper-eb6676b6ed0f25a45fb3a7c04633aa83f378c23d.tar.gz
socket_wrapper-eb6676b6ed0f25a45fb3a7c04633aa83f378c23d.tar.xz
socket_wrapper-eb6676b6ed0f25a45fb3a7c04633aa83f378c23d.zip
swrap: Fall back to RTLD_NEXT if we can't find libc.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10572 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 95c5c55..95643aa 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -393,10 +393,6 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
void *handle = NULL;
int i;
-#ifdef HAVE_APPLE
- return RTLD_NEXT;
-#endif
-
#ifdef RTLD_DEEPBIND
flags |= RTLD_DEEPBIND;
#endif
@@ -436,10 +432,14 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
}
if (handle == NULL) {
+#ifdef RTLD_NEXT
+ handle = swrap.libc_handle = swrap.libsocket_handle = RTLD_NEXT;
+#else
SWRAP_LOG(SWRAP_LOG_ERROR,
"Failed to dlopen library: %s\n",
dlerror());
exit(-1);
+#endif
}
return handle;