r25557: merge libreplace fixes from samba4
authorJelmer Vernooij <jelmer@samba.org>
Sat, 6 Oct 2007 23:07:33 +0000 (23:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:31:13 +0000 (12:31 -0500)
source/configure.in
source/lib/replace/README
source/lib/replace/getaddrinfo.h [moved from source/lib/replace/system/getaddrinfo.h with 100% similarity]
source/lib/replace/libreplace.m4
source/lib/replace/replace.h

index c36b430fccfe53c8985d1c6f128be8e213bfb2fb..e73edb418fac7bb91c0879a786752af9672b2d76 100644 (file)
@@ -3222,44 +3222,6 @@ if test x"$samba_cv_HAVE_STRUCT_SOCKADDR_IN6" = x"yes"; then
     AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,[Whether the system has struct sockaddr_in6])
 fi
 
-dnl test for struct addrinfo
-AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>],
-[
-struct addrinfo ai;
-],
-samba_cv_HAVE_STRUCT_ADDRINFO=yes,samba_cv_HAVE_STRUCT_ADDRINFO=no)])
-if test x"$samba_cv_HAVE_STRUCT_ADDRINFO" = x"yes"; then
-    AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,[Whether the system has struct addrinfo])
-fi
-
-dnl test for getaddrinfo/getnameinfo
-AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[
-AC_TRY_COMPILE([
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netdb.h>],
-[
-struct sockaddr sa;
-struct addrinfo *ai = NULL;
-int ret = getaddrinfo(NULL, NULL, NULL, &ai);
-if (ret != 0) {
-       const char *es = gai_strerror(ret);
-}
-freeaddrinfo(ai);
-ret = getnameinfo(&sa, sizeof(sa),
-               NULL, 0,
-               NULL, 0, 0);
-
-],
-samba_cv_HAVE_GETADDRINFO=yes,samba_cv_HAVE_GETADDRINFO=no)])
-if test x"$samba_cv_HAVE_GETADDRINFO" = x"yes"; then
-    AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo and getnameinfo])
-fi
-
 ################################################
 # look for a method of setting the effective uid
 seteuid=no;
index 77558b2ca96718f95c3e58a950b0697f1c685e70..c61f78a9513a7878600e16a084f4f4cc7dac29fd 100644 (file)
@@ -50,10 +50,16 @@ pwrite
 getpass
 readline (the library)
 inet_ntoa
+inet_ntop
+inet_pton
 strtoll
 strtoull
 socketpair
 strptime
+getaddrinfo
+freeaddrinfo
+getnameinfo
+gai_strerror
 
 Types:
 bool
index 354349187e7f8e8b236d2c1279db815657afb298..29ec2acdabbeb0c286b84ce0e753a2877aac159d 100644 (file)
@@ -137,6 +137,45 @@ if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
     AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
 fi
 
+dnl test for struct addrinfo
+AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>],
+[
+struct addrinfo ai;
+],
+samba_cv_HAVE_STRUCT_ADDRINFO=yes,samba_cv_HAVE_STRUCT_ADDRINFO=no)])
+if test x"$samba_cv_HAVE_STRUCT_ADDRINFO" = x"yes"; then
+    AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,[Whether the system has struct addrinfo])
+fi
+
+dnl test for getaddrinfo/getnameinfo
+AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[
+AC_TRY_COMPILE([
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netdb.h>],
+[
+struct sockaddr sa;
+struct addrinfo *ai = NULL;
+int ret = getaddrinfo(NULL, NULL, NULL, &ai);
+if (ret != 0) {
+       const char *es = gai_strerror(ret);
+}
+freeaddrinfo(ai);
+ret = getnameinfo(&sa, sizeof(sa),
+               NULL, 0,
+               NULL, 0, 0);
+
+],
+samba_cv_HAVE_GETADDRINFO=yes,samba_cv_HAVE_GETADDRINFO=no)])
+if test x"$samba_cv_HAVE_GETADDRINFO" = x"yes"; then
+    AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo and getnameinfo])
+fi
+
+
 dnl Provided by replace.c:
 AC_TRY_COMPILE([
 #include <sys/types.h>
index ca4becaa7087323c30ddec8d31f47ee498a9d520..26e39ac603dc6974212158a93361724581ebbf61 100644 (file)
@@ -330,22 +330,17 @@ ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset);
 ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset);
 #endif
 
-#include "system/network.h"
-
 #ifndef HAVE_INET_PTON
 int rep_inet_pton(int af, const char *src, void *dst);
 #define inet_pton rep_inet_pton
 #endif
 
 #ifndef HAVE_INET_NTOP
+#include "system/network.h"
 const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
 #define inet_ntop rep_inet_ntop
 #endif
 
-#if !defined(HAVE_GETADDRINFO)
-#include "system/getaddrinfo.h"
-#endif
-
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif