Fix from Chris Davis: get error-logging to be happy on win32.

svn:r1473
This commit is contained in:
Nick Mathewson 2009-10-27 18:25:19 +00:00
parent 904b5721cb
commit e9098203f7

View File

@ -412,8 +412,9 @@ test_evutil_log(void *ptr)
fd = socket(AF_INET, SOCK_STREAM, 0); fd = socket(AF_INET, SOCK_STREAM, 0);
#ifdef WIN32 #ifdef WIN32
evutil_snprintf(buf, sizeof(buf), evutil_snprintf(buf, sizeof(buf),
"Unhappy socket: Resource temporarily unavailable"); "Unhappy socket: %s",
EVUTIL_SET_SOCKET_ERROR(fd, WSAEWOULDBLOCK); evutil_socket_error_to_string(WSAEWOULDBLOCK));
EVUTIL_SET_SOCKET_ERROR(WSAEWOULDBLOCK);
#else #else
evutil_snprintf(buf, sizeof(buf), evutil_snprintf(buf, sizeof(buf),
"Unhappy socket: %s", strerror(EAGAIN)); "Unhappy socket: %s", strerror(EAGAIN));
@ -425,7 +426,7 @@ test_evutil_log(void *ptr)
RESET(); RESET();
#ifdef WIN32 #ifdef WIN32
EVUTIL_SET_SOCKET_ERROR(fd, WSAEWOULDBLOCK); EVUTIL_SET_SOCKET_ERROR(WSAEWOULDBLOCK);
#else #else
errno = EAGAIN; errno = EAGAIN;
#endif #endif