]> granicus.if.org Git - postgresql/commitdiff
Don't build replacement getpeereid function on mingw.
authorAndrew Dunstan <andrew@dunslane.net>
Tue, 26 Jul 2011 03:46:52 +0000 (23:46 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 26 Jul 2011 03:46:52 +0000 (23:46 -0400)
Windows doesn't have Unix sockets, so it's not needed, and moreover causes compile warnings.

configure
configure.in

index d01032f82b073129ff2f9b809511ac27e075f3e4..4d8e5bfb6c4b0c3f9809cfdd2cc5a3272bbef00d 100755 (executable)
--- a/configure
+++ b/configure
@@ -20423,8 +20423,7 @@ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
 
 
-
-for ac_func in crypt erand48 getopt getpeereid getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul
+for ac_func in crypt erand48 getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -20536,16 +20535,25 @@ done
 case $host_os in
 
         # Windows uses a specialised env handler
+        # and doesn't need a replacement getpeereid because it doesn't use
+        # Unix sockets.
         mingw*)
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_UNSETENV 1
 _ACEOF
 
-                ac_cv_func_unsetenv=yes;;
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPEEREID 1
+_ACEOF
+
+                ac_cv_func_unsetenv=yes
+                ac_cv_func_getpeereid=yes;;
         *)
 
-for ac_func in unsetenv
+
+for ac_func in unsetenv getpeereid
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
index dcbc98e0c087a86ac8fe9e5307fb3c72861bc00a..b360d3e303395613ee7a9e6d24c5825550dc8dd8 100644 (file)
@@ -1310,16 +1310,20 @@ fi
 pgac_save_LIBS="$LIBS"
 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
-AC_REPLACE_FUNCS([crypt erand48 getopt getpeereid getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul])
+AC_REPLACE_FUNCS([crypt erand48 getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul])
 
 case $host_os in
 
         # Windows uses a specialised env handler
+        # and doesn't need a replacement getpeereid because it doesn't use
+        # Unix sockets.
         mingw*)
                 AC_DEFINE(HAVE_UNSETENV, 1, [Define to 1 because replacement version used.])
-                ac_cv_func_unsetenv=yes;;
+                AC_DEFINE(HAVE_GETPEEREID, 1, [Define to 1 because function not required.])
+                ac_cv_func_unsetenv=yes
+                ac_cv_func_getpeereid=yes;;
         *)
-                AC_REPLACE_FUNCS([unsetenv])
+                AC_REPLACE_FUNCS([unsetenv getpeereid])
                ;;
 esac