Big header file cleanup: everything that has to do with standard system
[tinc] / lib / fake-getaddrinfo.c
index d831732..e170680 100644 (file)
@@ -9,16 +9,7 @@
  * that ai_family is AF_INET. Don't use it for another purpose.
  */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <system.h>
+#include "system.h"
 
 #include "fake-getaddrinfo.h"
 
@@ -97,12 +88,14 @@ int getaddrinfo(const char *hostname, const char *servname,
                        return EAI_MEMORY;
        }
        
+#ifdef HAVE_INET_ATON
        if (inet_aton(hostname, &in)) {
                if (NULL != (*res = malloc_ai(port, in.s_addr)))
                        return 0;
                else
                        return EAI_MEMORY;
        }
+#endif
        
        hp = gethostbyname(hostname);
        if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {