Index: src/bin/initdb/initdb.c =================================================================== RCS file: /home/cvsmirror/pgsql/src/bin/initdb/initdb.c,v retrieving revision 1.94 diff -c -r1.94 initdb.c *** src/bin/initdb/initdb.c 2 Aug 2005 15:16:27 -0000 1.94 --- src/bin/initdb/initdb.c 22 Aug 2005 13:35:22 -0000 *************** *** 1157,1162 **** --- 1157,1174 ---- char **conflines; char repltok[100]; char path[MAXPGPATH]; + + struct addrinfo *gai_result; + struct addrinfo hints; + + hints.ai_flags = AI_NUMERICHOST; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = 0; + hints.ai_protocol = 0; + hints.ai_addrlen = 0; + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; fputs(_("creating configuration files ... "), stdout); fflush(stdout); *************** *** 1210,1220 **** conflines = replace_token(conflines,"@remove-line-for-nolocal@",""); #endif ! #ifndef HAVE_IPV6 ! conflines = replace_token(conflines, ! "host all all ::1", ! "#host all all ::1"); ! #endif /* Replace default authentication methods */ conflines = replace_token(conflines, --- 1222,1239 ---- conflines = replace_token(conflines,"@remove-line-for-nolocal@",""); #endif ! ! /* ! * runtime test for IPv6 support (previously compile time test). ! * this lets us build on hosts with IPv6 support and run ! * on hosts without, especially on Windows. ! * ! */ ! if (getaddrinfo("::1", NULL, &hints, &gai_result) != 0) ! conflines = replace_token(conflines, ! "host all all ::1", ! "#host all all ::1"); ! /* Replace default authentication methods */ conflines = replace_token(conflines,