Avoid test segfault on x86_64 due to lack of inet_ntop declaration.
[pspp] / tests / test-getaddrinfo.c
index 00a980b1bda2dc3e97e1d6406e89fbeb1b6c4913..8d487cb5bf48c90492710bee2c7ef01e4a2d9511 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <config.h>
 #include "getaddrinfo.h"
-#include "inet_ntop.h"
+#include <arpa/inet.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -54,10 +54,18 @@ int simple (char *host, char *service)
 
   if (res != 0)
     {
+      /* IRIX reports EAI_NONAME for "https".  Don't fail the test
+        merely because of this.  */
+      if (res == EAI_NONAME)
+       return 0;
       /* Solaris reports EAI_SERVICE for "http" and "https".  Don't
          fail the test merely because of this.  */
       if (res == EAI_SERVICE)
        return 0;
+      /* AIX reports EAI_NODATA for "https".  Don't fail the test
+        merely because of this.  */
+      if (res == EAI_NODATA)
+       return 0;
 
       return 1;
     }