diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-23 02:18:44 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-23 02:18:44 +0200 |
commit | cf94994f8e3b34bc871e2c3b2558f8301146810c (patch) | |
tree | 4af0a1b7161e077689f077bb5e14083b8c51b638 /source/cTCPLink.cpp | |
parent | Found something that calls a function when a segfault happens, might be useful. (diff) | |
download | cuberite-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 'source/cTCPLink.cpp')
-rw-r--r-- | source/cTCPLink.cpp | 8 |
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;
|