1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

nwrap: Fall back to RTLD_NEXT if we can't find libc.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Andreas Schneider 2014-10-09 09:13:48 +02:00 committed by Andreas Schneider
parent 1b27b73c60
commit 6979082779

View File

@ -562,10 +562,6 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib)
void *handle = NULL;
int i;
#ifdef HAVE_APPLE
return RTLD_NEXT;
#endif
#ifdef RTLD_DEEPBIND
flags |= RTLD_DEEPBIND;
#endif
@ -619,10 +615,17 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib)
}
if (handle == NULL) {
#ifdef RTLD_NEXT
handle = nwrap_main_global->libc->handle
= nwrap_main_global->libc->sock_handle
= nwrap_main_global->libc->nsl_handle
= RTLD_NEXT;
#else
NWRAP_LOG(NWRAP_LOG_ERROR,
"Failed to dlopen library: %s\n",
dlerror());
exit(-1);
#endif
}
return handle;