summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-27 21:34:54 +0100
committermadmaxoft <github@xoft.cz>2014-01-27 21:34:54 +0100
commita359275064ecbaf3608995e82875532419a8ed80 (patch)
treeeb3419868f66b0015523cf029d222ef4a47ccc5a
parentFixed Linux compilation. (diff)
downloadcuberite-a359275064ecbaf3608995e82875532419a8ed80.tar
cuberite-a359275064ecbaf3608995e82875532419a8ed80.tar.gz
cuberite-a359275064ecbaf3608995e82875532419a8ed80.tar.bz2
cuberite-a359275064ecbaf3608995e82875532419a8ed80.tar.lz
cuberite-a359275064ecbaf3608995e82875532419a8ed80.tar.xz
cuberite-a359275064ecbaf3608995e82875532419a8ed80.tar.zst
cuberite-a359275064ecbaf3608995e82875532419a8ed80.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/Socket.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/OSSupport/Socket.cpp b/src/OSSupport/Socket.cpp
index 064abbab5..6afaceedf 100644
--- a/src/OSSupport/Socket.cpp
+++ b/src/OSSupport/Socket.cpp
@@ -361,24 +361,17 @@ void cSocket::SetNonBlocking(void)
#ifdef _WIN32
u_long NonBlocking = 1;
int res = ioctlsocket(m_Socket, FIONBIO, &NonBlocking);
- if (res != 0)
- {
- LOGERROR("Cannot set socket to non-blocking. This would make the server deadlock later on, aborting.\nErr: %d, %d, %s",
- res, GetLastError(), GetLastErrorString().c_str()
- );
- abort();
- }
#else
int NonBlocking = 1;
int res = ioctl(m_Socket, FIONBIO, (char *)&NonBlocking);
- if (res != 0)
- {
- LOGERROR("Cannot set socket to non-blocking. This would make the server deadlock later on, aborting.\nErr: %d, %d, %s",
- res, GetLastError(), GetLastErrorString().c_str()
- );
- abort();
- }
#endif
+ if (res != 0)
+ {
+ LOGERROR("Cannot set socket to non-blocking. This would make the server deadlock later on, aborting.\nErr: %d, %d, %s",
+ res, GetLastError(), GetLastErrorString().c_str()
+ );
+ abort();
+ }
}