summaryrefslogtreecommitdiffstats
path: root/lib/socket_wrapper
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-05-08 14:07:16 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-05-09 09:03:33 +0200
commita05728df56c3bc8e07ac3e8b59309adc0e4fa33c (patch)
tree5cf3a8d51d247cd182c5dab58ecb7b44434eda1a /lib/socket_wrapper
parentb003f1a453750d69b2f5d166fd865fda4463c79a (diff)
downloadsamba-a05728df56c3bc8e07ac3e8b59309adc0e4fa33c.tar.gz
samba-a05728df56c3bc8e07ac3e8b59309adc0e4fa33c.tar.xz
samba-a05728df56c3bc8e07ac3e8b59309adc0e4fa33c.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 'lib/socket_wrapper')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 95c5c556935..95643aa7bd1 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/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;