summaryrefslogtreecommitdiffstats
path: root/source/cTCPLink.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-23 02:18:44 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-23 02:18:44 +0200
commitcf94994f8e3b34bc871e2c3b2558f8301146810c (patch)
tree4af0a1b7161e077689f077bb5e14083b8c51b638 /source/cTCPLink.cpp
parentFound something that calls a function when a segfault happens, might be useful. (diff)
downloadcuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.gz
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.bz2
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.lz
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.xz
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.zst
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.zip
Diffstat (limited to '')
-rw-r--r--source/cTCPLink.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/cTCPLink.cpp b/source/cTCPLink.cpp
index 0efc0254f..bfd987bd9 100644
--- a/source/cTCPLink.cpp
+++ b/source/cTCPLink.cpp
@@ -5,10 +5,10 @@
#include "MCSocket.h"
#include "cMCLogger.h"
+#include <errno.h>
#ifndef _WIN32
#include <cstring>
-#include <errno.h>
#endif
#ifdef _WIN32
@@ -66,11 +66,7 @@ bool cTCPLink::Connect( const char* a_Address, unsigned int a_Port )
#endif
m_Socket=socket(AF_INET,SOCK_STREAM,0);
-#ifdef _WIN32
- if( m_Socket==INVALID_SOCKET )
-#else
- if( m_Socket < 0 )
-#endif
+ if( !m_Socket.IsValid() )
{
LOGERROR("cTCPLink: Invalid socket");
m_Socket = 0;