From eb6676b6ed0f25a45fb3a7c04633aa83f378c23d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 29 Apr 2014 11:07:06 +0200 Subject: 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 Reviewed-by: Stefan Metzmacher --- src/socket_wrapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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; -- cgit