Browse code

configure: use AF_UNSPEC when testing getaddrinfo() (bb#1196)

git-svn: trunk@4198

Tomasz Kojm authored on 2008/09/23 06:29:14
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Sep 22 23:38:16 CEST 2008 (tk)
2
+----------------------------------
3
+  * configure: use AF_UNSPEC when testing getaddrinfo() (bb#1196)
4
+
1 5
 Thu Sep 18 12:13:56 CEST 2008 (tk)
2 6
 ----------------------------------
3 7
   * freshclam/manager.c: fix version check for builds compiled with
... ...
@@ -16230,10 +16230,12 @@ cat >>conftest.$ac_ext <<_ACEOF
16230 16230
 		    #include <unistd.h>
16231 16231
 		    int main(int argc, char **argv)
16232 16232
 		    {
16233
-			    struct addrinfo *res;
16233
+			    struct addrinfo *res, hints;
16234 16234
 			    int sd;
16235 16235
 
16236
-			if(getaddrinfo("127.0.0.1", NULL, NULL, &res) < 0)
16236
+			memset(&hints, 0, sizeof(hints));
16237
+			hints.ai_family = AF_UNSPEC;
16238
+			if(getaddrinfo("127.0.0.1", NULL, &hints, &res) < 0)
16237 16239
 			    return 1;
16238 16240
 			freeaddrinfo(res);
16239 16241
 
... ...
@@ -481,10 +481,12 @@ then
481 481
 		    #include <unistd.h>
482 482
 		    int main(int argc, char **argv)
483 483
 		    {
484
-			    struct addrinfo *res;
484
+			    struct addrinfo *res, hints;
485 485
 			    int sd;
486 486
 
487
-			if(getaddrinfo("127.0.0.1", NULL, NULL, &res) < 0)
487
+			memset(&hints, 0, sizeof(hints));
488
+			hints.ai_family = AF_UNSPEC;
489
+			if(getaddrinfo("127.0.0.1", NULL, &hints, &res) < 0)
488 490
 			    return 1;
489 491
 			freeaddrinfo(res);
490 492