From 9711f77313e6d72696b0807acfea5d41ff89dfa7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 31 Jul 2014 10:13:40 +0200 Subject: uwrap: Fall back to RTLD_NEXT if we can't find libc. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam --- lib/uid_wrapper/uid_wrapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c index b77aa023ece..e9c7d5a94ea 100644 --- a/lib/uid_wrapper/uid_wrapper.c +++ b/lib/uid_wrapper/uid_wrapper.c @@ -194,10 +194,6 @@ static void *uwrap_load_lib_handle(enum uwrap_lib lib) void *handle = NULL; int i; -#ifdef HAVE_APPLE - return RTLD_NEXT; -#endif - #ifdef RTLD_DEEPBIND flags |= RTLD_DEEPBIND; #endif @@ -223,10 +219,14 @@ static void *uwrap_load_lib_handle(enum uwrap_lib lib) } if (handle == NULL) { +#ifdef RTLD_NEXT + handle = uwrap.libc.handle = RTLD_NEXT; +#else fprintf(stderr, "Failed to dlopen library: %s\n", dlerror()); exit(-1); +#endif } return handle; -- cgit v1.2.1