summaryrefslogtreecommitdiffstats
path: root/source/cSocket.cpp
diff options
context:
space:
mode:
authorcedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-08 14:23:56 +0200
committercedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-08 14:23:56 +0200
commitbda3b96681df645a8df43b273f6acebce7760e72 (patch)
tree4bb3619c03d6037a99f1fa0140b89aeca659ec52 /source/cSocket.cpp
parentSugarcane and Pumpkins get placed (quite rarely) in the SprinkleSmallFoliage FinishGen (diff)
downloadcuberite-bda3b96681df645a8df43b273f6acebce7760e72.tar
cuberite-bda3b96681df645a8df43b273f6acebce7760e72.tar.gz
cuberite-bda3b96681df645a8df43b273f6acebce7760e72.tar.bz2
cuberite-bda3b96681df645a8df43b273f6acebce7760e72.tar.lz
cuberite-bda3b96681df645a8df43b273f6acebce7760e72.tar.xz
cuberite-bda3b96681df645a8df43b273f6acebce7760e72.tar.zst
cuberite-bda3b96681df645a8df43b273f6acebce7760e72.zip
Diffstat (limited to '')
-rw-r--r--source/cSocket.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/cSocket.cpp b/source/cSocket.cpp
index 595b423b8..7fc67e258 100644
--- a/source/cSocket.cpp
+++ b/source/cSocket.cpp
@@ -111,21 +111,21 @@ AString cSocket::GetErrorString( int a_ErrNo )
// According to http://linux.die.net/man/3/strerror_r there are two versions of strerror_r():
- #if ((((_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600)) && ! _GNU_SOURCE && !__APPLE__) || __CYGWIN32__ || __APPLE__ ) // XSI version of strerror_r():
+ #if ( _GNU_SOURCE ) // GNU version of strerror_r()
- int res = strerror_r( errno, buffer, ARRAYCOUNT(buffer) );
- if( res == 0 )
+ char * res = strerror_r( errno, buffer, ARRAYCOUNT(buffer) );
+ if( res != NULL )
{
- Printf(Out, "%d: %s", a_ErrNo, buffer);
+ Printf(Out, "%d: %s", a_ErrNo, res);
return Out;
}
- #else // GNU version of strerror_r()
+ #else // XSI version of strerror_r():
- char * res = strerror_r( errno, buffer, ARRAYCOUNT(buffer) );
- if( res != NULL )
+ int res = strerror_r( errno, buffer, ARRAYCOUNT(buffer) );
+ if( res == 0 )
{
- Printf(Out, "%d: %s", a_ErrNo, res);
+ Printf(Out, "%d: %s", a_ErrNo, buffer);
return Out;
}