The branch, master has been updated via 9f1da66 nwrap: Fix the handle loops for older gcc versions. from 2192e08 Bump version to 1.0.3.
http://gitweb.samba.org/?p=nss_wrapper.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 9f1da664220a5da1d8b4c52a17f819672ace9928 Author: Andreas Schneider <a...@samba.org> Date: Wed Oct 1 17:15:35 2014 +0200 nwrap: Fix the handle loops for older gcc versions. Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> ----------------------------------------------------------------------- Summary of changes: src/nss_wrapper.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c index a41de9e..28c23d8 100644 --- a/src/nss_wrapper.c +++ b/src/nss_wrapper.c @@ -575,11 +575,14 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib) #ifdef HAVE_LIBNSL handle = nwrap_main_global->libc->nsl_handle; if (handle == NULL) { - for (handle = NULL, i = 10; handle == NULL && i >= 0; i--) { + for (i = 10; i >= 0; i--) { char soname[256] = {0}; snprintf(soname, sizeof(soname), "libnsl.so.%d", i); handle = dlopen(soname, flags); + if (handle != NULL) { + break; + } } nwrap_main_global->libc->nsl_handle = handle; @@ -591,11 +594,14 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib) #ifdef HAVE_LIBSOCKET handle = nwrap_main_global->libc->sock_handle; if (handle == NULL) { - for (handle = NULL, i = 10; handle == NULL && i >= 0; i--) { + for (i = 10; i >= 0; i--) { char soname[256] = {0}; snprintf(soname, sizeof(soname), "libsocket.so.%d", i); handle = dlopen(soname, flags); + if (handle != NULL) { + break; + } } nwrap_main_global->libc->sock_handle = handle; @@ -606,11 +612,14 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib) case NWRAP_LIBC: handle = nwrap_main_global->libc->handle; if (handle == NULL) { - for (handle = NULL, i = 10; handle == NULL && i >= 0; i--) { + for (i = 10; i >= 0; i--) { char soname[256] = {0}; snprintf(soname, sizeof(soname), "libc.so.%d", i); handle = dlopen(soname, flags); + if (handle != NULL) { + break; + } } nwrap_main_global->libc->handle = handle; -- NSS Wrapper Repository