[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2486-g26e6ebc

Michael Adam obnox at samba.org
Thu Feb 21 23:37:02 GMT 2008


The branch, v3-2-test has been updated
       via  26e6ebc7090b5742deb67805d85d809cafb4543d (commit)
       via  ec9f4f5066ba7a8bf3af931fd4969590140c0b2b (commit)
       via  65710e752f72070cb911867ff9f31f91904ca5c0 (commit)
      from  a2230ccc1700af02f5a5caedd2e66e6f4c14bb5c (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 26e6ebc7090b5742deb67805d85d809cafb4543d
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 22 00:34:41 2008 +0100

    libreplace: fix creation of conftest files for getifaddrs tests.
    
    Add missing includes of replace.c and defines of SOCKET_WRAPPER_NOT_REPLACE.
    
    Michael

commit ec9f4f5066ba7a8bf3af931fd4969590140c0b2b
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 22 00:27:00 2008 +0100

    Fix linked list of ifaddrs in implementations of rep_getifaddrs.
    
    Produce proper list instead of one-node-loop.
    
    Michael

commit 65710e752f72070cb911867ff9f31f91904ca5c0
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 22 00:24:11 2008 +0100

    Add missing initalizations of lastif in rep_getifaddr implementations.
    
    Michael

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

Summary of changes:
 source/lib/replace/getifaddrs.c  |   15 +++++++++------
 source/lib/replace/getifaddrs.m4 |   15 +++++++++++----
 2 files changed, 20 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/replace/getifaddrs.c b/source/lib/replace/getifaddrs.c
index f12062b..37cd950 100644
--- a/source/lib/replace/getifaddrs.c
+++ b/source/lib/replace/getifaddrs.c
@@ -84,7 +84,8 @@ int rep_getifaddrs(struct ifaddrs **ifap)
 	struct in_addr ipaddr;
 	struct in_addr nmask;
 	char *iname;
-	struct ifaddrs *curif, *lastif;
+	struct ifaddrs *curif;
+	struct ifaddrs *lastif = NULL;
 
 	*ifap = NULL;
 
@@ -114,7 +115,7 @@ int rep_getifaddrs(struct ifaddrs **ifap)
 		if (lastif == NULL) {
 			*ifap = curif;
 		} else {
-			lastif->ifa_next = (*ifap);
+			lastif->ifa_next = curif;
 		}
 
 		curif->ifa_name = strdup(ifr[i].ifr_name);
@@ -168,7 +169,8 @@ int rep_getifaddrs(struct ifaddrs **ifap)
 	struct in_addr ipaddr;
 	struct in_addr nmask;
 	char *iname;
-	struct ifaddrs *curif, *lastif;
+	struct ifaddrs *curif;
+	struct ifaddrs *lastif = NULL;
 
 	*ifap = NULL;
 
@@ -206,7 +208,7 @@ int rep_getifaddrs(struct ifaddrs **ifap)
 		if (lastif == NULL) {
 			*ifap = curif;
 		} else {
-			lastif->ifa_next = (*ifap);
+			lastif->ifa_next = curif;
 		}
 
 		strioctl.ic_cmd = SIOCGIFFLAGS;
@@ -268,7 +270,8 @@ int rep_getifaddrs(struct ifaddrs **ifap)
 	struct in_addr ipaddr;
 	struct in_addr nmask;
 	char *iname;
-	struct ifaddrs *curif, *lastif;
+	struct ifaddrs *curif;
+	struct ifaddrs *lastif = NULL;
 
 	*ifap = NULL;
 
@@ -303,7 +306,7 @@ int rep_getifaddrs(struct ifaddrs **ifap)
 		if (lastif == NULL) {
 			*ifap = curif;
 		} else {
-			lastif->ifa_next = (*ifap);
+			lastif->ifa_next = curif;
 		}
 
 		curif->ifa_name = strdup(ifr->ifr_name);
diff --git a/source/lib/replace/getifaddrs.m4 b/source/lib/replace/getifaddrs.m4
index 5d5edf1..dd2a95c 100644
--- a/source/lib/replace/getifaddrs.m4
+++ b/source/lib/replace/getifaddrs.m4
@@ -44,9 +44,10 @@ iface=no;
 iface=no;
 AC_CACHE_CHECK([for iface getifaddrs],libreplace_cv_HAVE_IFACE_GETIFADDRS,[
 AC_TRY_RUN([
-#define NO_CONFIG_H 1
 #define HAVE_IFACE_GETIFADDRS 1
+#define NO_CONFIG_H 1
 #define AUTOCONF_TEST 1
+#define SOCKET_WRAPPER_NOT_REPLACE
 #include "$libreplacedir/replace.c"
 #include "$libreplacedir/getifaddrs.c"],
            libreplace_cv_HAVE_IFACE_GETIFADDRS=yes,libreplace_cv_HAVE_IFACE_GETIFADDRS=no,libreplace_cv_HAVE_IFACE_GETIFADDRS=cross)])
@@ -60,10 +61,12 @@ fi
 if test $iface = no; then
 AC_CACHE_CHECK([for iface AIX],libreplace_cv_HAVE_IFACE_AIX,[
 AC_TRY_RUN([
-#define NO_CONFIG_H 1
 #define HAVE_IFACE_AIX 1
+#define NO_CONFIG_H 1
 #define AUTOCONF_TEST 1
 #undef _XOPEN_SOURCE_EXTENDED
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
 #include "$libreplacedir/getifaddrs.c"],
            libreplace_cv_HAVE_IFACE_AIX=yes,libreplace_cv_HAVE_IFACE_AIX=no,libreplace_cv_HAVE_IFACE_AIX=cross)])
 if test x"$libreplace_cv_HAVE_IFACE_AIX" = x"yes"; then
@@ -75,9 +78,11 @@ fi
 if test $iface = no; then
 AC_CACHE_CHECK([for iface ifconf],libreplace_cv_HAVE_IFACE_IFCONF,[
 AC_TRY_RUN([
-#define NO_CONFIG_H 1
 #define HAVE_IFACE_IFCONF 1
+#define NO_CONFIG_H 1
 #define AUTOCONF_TEST 1
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
 #include "$libreplacedir/getifaddrs.c"],
            libreplace_cv_HAVE_IFACE_IFCONF=yes,libreplace_cv_HAVE_IFACE_IFCONF=no,libreplace_cv_HAVE_IFACE_IFCONF=cross)])
 if test x"$libreplace_cv_HAVE_IFACE_IFCONF" = x"yes"; then
@@ -88,9 +93,11 @@ fi
 if test $iface = no; then
 AC_CACHE_CHECK([for iface ifreq],libreplace_cv_HAVE_IFACE_IFREQ,[
 AC_TRY_RUN([
-#define NO_CONFIG_H 1
 #define HAVE_IFACE_IFREQ 1
+#define NO_CONFIG_H 1
 #define AUTOCONF_TEST 1
+#define SOCKET_WRAPPER_NOT_REPLACE
+#include "$libreplacedir/replace.c"
 #include "$libreplacedir/getifaddrs.c"],
            libreplace_cv_HAVE_IFACE_IFREQ=yes,libreplace_cv_HAVE_IFACE_IFREQ=no,libreplace_cv_HAVE_IFACE_IFREQ=cross)])
 if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then


-- 
Samba Shared Repository


More information about the samba-cvs mailing list