10 Aug 2012 13:17
adig.c calls perror()
adig.c calls perror() when select() fail. This doesn't work on
Winsock; perror() prints errno string, not WSAGetLastError().
So I suggest we add a new ares_perror() function to ares_strerror.c:
--- Git-latest\ares_strerror.c Wed Oct 12 11:43:31 2011
+++ ares_strerror.c Fri Aug 10 13:01:10 2012
<at> <at> -54,3 +54,17 <at> <at>
else
return "unknown";
}
+
+/* perror() doesn't show Winsock errors.
+ */
+void ares_perror (const char *str)
+{
+#ifdef USE_WINSOCK
+ if (str && *str)
+ fprintf (stderr, "%s: ", str);
+ fprintf (stderr, "Winsock error %d\n", SOCKERRNO);
+#else
+ perror (str);
+#endif
+}
+
And a prototype for it in ares.h:
--- Git-latest\ares.h Sun Jun 24 21:37:50 2012
+++ ares.h Fri Aug 10 12:58:25 2012
<at> <at> -547,6 +547,8 <at> <at>
(Continue reading)
RSS Feed