summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-15 21:11:36 +0100
committerMattes D <github@xoft.cz>2015-01-22 20:12:58 +0100
commit60807adfb577552bc462660920f42fac0c3c60f3 (patch)
tree144f1853d397ade5d524edf235bfa81c02f3189b
parentcNetwork: Added an OnError callback for listening servers. (diff)
downloadcuberite-60807adfb577552bc462660920f42fac0c3c60f3.tar
cuberite-60807adfb577552bc462660920f42fac0c3c60f3.tar.gz
cuberite-60807adfb577552bc462660920f42fac0c3c60f3.tar.bz2
cuberite-60807adfb577552bc462660920f42fac0c3c60f3.tar.lz
cuberite-60807adfb577552bc462660920f42fac0c3c60f3.tar.xz
cuberite-60807adfb577552bc462660920f42fac0c3c60f3.tar.zst
cuberite-60807adfb577552bc462660920f42fac0c3c60f3.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/Network.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/OSSupport/Network.cpp b/src/OSSupport/Network.cpp
index 4dc8d1df1..c26a8e17d 100644
--- a/src/OSSupport/Network.cpp
+++ b/src/OSSupport/Network.cpp
@@ -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: