summaryrefslogtreecommitdiffstats
path: root/source/cSocket.cpp
diff options
context:
space:
mode:
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;
}