1
0

cNetwork: Handle WSA initialization failures.

This commit is contained in:
Mattes D 2015-01-15 21:11:36 +01:00
parent 7cddb62374
commit 60807adfb5

View File

@ -1076,7 +1076,13 @@ cNetworkSingleton::cNetworkSingleton(void)
#ifdef _WIN32
WSADATA wsaData;
memset(&wsaData, 0, sizeof(wsaData));
WSAStartup (MAKEWORD(2, 2), &wsaData);
int res = WSAStartup (MAKEWORD(2, 2), &wsaData);
if (res != 0)
{
int err = WSAGetLastError();
LOGWARNING("WSAStartup failed: %d, WSAGLE = %d (%s)", res, err, evutil_socket_error_to_string(err));
exit(1);
}
#endif // _WIN32
// Initialize LibEvent logging: