1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-06 03:09:40 +00:00

ares_init: fix gethostname error detection on winsock platforms

This commit is contained in:
Yang Tse
2011-03-22 13:43:34 +01:00
parent cd753ffe14
commit ef8e2ad601

View File

@ -1050,10 +1050,13 @@ static int init_by_defaults(ares_channel channel)
channel->nservers = 1;
}
#ifdef ENAMETOOLONG
#define toolong(x) (x == -1) && ((ENAMETOOLONG == errno) || (EINVAL == errno))
#if defined(USE_WINSOCK)
#define toolong(x) (x == -1) && (SOCKERRNO == WSAEFAULT)
#elif defined(ENAMETOOLONG)
#define toolong(x) (x == -1) && ((SOCKERRNO == ENAMETOOLONG) || \
(SOCKERRNO == EINVAL))
#else
#define toolong(x) (x == -1) && (EINVAL == errno)
#define toolong(x) (x == -1) && (SOCKERRNO == EINVAL)
#endif
if (channel->ndomains == -1) {