Check return value for ioctlsocket on win32

This commit is contained in:
Trond Norbye 2010-10-27 12:47:07 +02:00
parent f13e449b53
commit f5ad31c186

View File

@ -266,8 +266,11 @@ evutil_make_socket_nonblocking(evutil_socket_t fd)
{ {
#ifdef WIN32 #ifdef WIN32
{ {
unsigned long nonblocking = 1; u_long nonblocking = 1;
ioctlsocket(fd, FIONBIO, (unsigned long*) &nonblocking); if (ioctlsocket(fd, FIONBIO, &nonblocking) == SOCKET_ERROR) {
event_warn("fcntl(%d, F_GETFL)", (int)fd);
return -1;
}
} }
#else #else
{ {