[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Oct 1 09:13:10 MDT 2014


The branch, master has been updated
       via  95c39b3 swrap: Fix the loop for older gcc versions.
      from  163f089 Bump version to 1.1.2.

http://gitweb.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 95c39b39f2f4529b9f59471fd3a99afdd57058ee
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Oct 1 16:59:29 2014 +0200

    swrap: Fix the loop for older gcc versions.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 src/socket_wrapper.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index d5c343d..b30303f 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -452,11 +452,14 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
 #ifdef HAVE_LIBSOCKET
 		handle = swrap.libsocket_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;
+				}
 			}
 
 			swrap.libsocket_handle = handle;
@@ -474,11 +477,14 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
 		}
 #endif
 		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;
+				}
 			}
 
 			swrap.libc_handle = handle;


-- 
Socket Wrapper Repository


More information about the samba-cvs mailing list