From 3b17379de00e97ace6030018ccba501f9a9bb279 Mon Sep 17 00:00:00 2001 From: Christophe Mutricy Date: Fri, 2 Mar 2007 18:51:48 +0000 Subject: [PATCH] Compile fix + define undefined error value --- src/network/getaddrinfo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c index 40d6a0ce37..8f76de8595 100644 --- a/src/network/getaddrinfo.c +++ b/src/network/getaddrinfo.c @@ -53,6 +53,9 @@ #ifndef AF_UNSPEC # define AF_UNSPEC 0 #endif +#ifndef EAI_OVERFLOW +# define EAI_OVERFLOW -12 /* Argument buffer overflow. */ +#endif #define _NI_MASK (NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|\ NI_DGRAM) @@ -171,7 +174,7 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen, } /* inet_ntoa() is not thread-safe, do not use it */ - uint32_t ipv4 = ntohl (addr->sin_addr); + uint32_t ipv4 = ntohl (addr->sin_addr.s_addr); if (snprintf (host, hostlen, "%u.%u.%u.%u", ipv4 >> 24, (ipv4 >> 16) & 0xff, (ipv4 >> 8) & 0xff, -- 2.39.5