ares_init: fix gethostname error detection on winsock platforms

pull/4/head
Yang Tse 14 years ago
parent cd753ffe14
commit ef8e2ad601
  1. 9
      ares_init.c

@ -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) {

Loading…
Cancel
Save