diff options
author | Andreas Schneider <asn@samba.org> | 2015-01-23 13:59:14 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-01-28 17:17:07 +0100 |
commit | 6ca1cf208e0cb0af2153e9d559592730d5acb74c (patch) | |
tree | c708d688cf9955d9697008a698610f55ed429af3 /lib | |
parent | cf68c1accb50f4d8449e993c630559a3d3e9dd36 (diff) | |
download | samba-6ca1cf208e0cb0af2153e9d559592730d5acb74c.tar.gz |
uwrap: Fix the handle loop for older gcc versions.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/uid_wrapper/uid_wrapper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c index 2181767246e..c1dc56b7749 100644 --- a/lib/uid_wrapper/uid_wrapper.c +++ b/lib/uid_wrapper/uid_wrapper.c @@ -271,11 +271,14 @@ static void *uwrap_load_lib_handle(enum uwrap_lib lib) case UWRAP_LIBC: handle = uwrap.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; + } } uwrap.libc.handle = handle; |