adig: perror() doesn't work for socket errors on windows
authorGisle Vanem <gvanem@broadpark.no>
Fri, 24 Aug 2012 21:17:26 +0000 (23:17 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Aug 2012 21:17:26 +0000 (23:17 +0200)
... so print the SOCKERRNO instead

adig.c

diff --git a/adig.c b/adig.c
index ff1cd44..47fa5a4 100644 (file)
--- 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);