cNetwork: Handle WSA initialization failures.
This commit is contained in:
parent
7cddb62374
commit
60807adfb5
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user