From: Gisle Vanem Date: Fri, 24 Aug 2012 21:17:26 +0000 (+0200) Subject: adig: perror() doesn't work for socket errors on windows X-Git-Tag: upstream/1.10.0~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=805c736e36a1c2cd4909ccbb9eede0657e29d6fc;p=platform%2Fupstream%2Fc-ares.git adig: perror() doesn't work for socket errors on windows ... so print the SOCKERRNO instead --- diff --git a/adig.c b/adig.c index ff1cd44..47fa5a4 100644 --- a/adig.c +++ b/adig.c @@ -390,9 +390,9 @@ int main(int argc, char **argv) break; tvp = ares_timeout(channel, NULL, &tv); count = select(nfds, &read_fds, &write_fds, NULL, tvp); - if (count < 0 && SOCKERRNO != EINVAL) + if (count < 0 && (status = SOCKERRNO) != EINVAL) { - perror("select"); + printf("select fail: %d", status); return 1; } ares_process(channel, &read_fds, &write_fds);