diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-01-25 14:51:03 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-01-25 14:51:03 +0100 |
commit | 59b8205f02eb7bf2954acba56fd63f485a30ece5 (patch) | |
tree | 55baedf13c6c5cc132ca0f81d6c30c01a434be2d /src/OSSupport/Socket.cpp | |
parent | Switched cEvent to use strerror_r for error messages (diff) | |
download | cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.tar cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.tar.gz cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.tar.bz2 cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.tar.lz cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.tar.xz cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.tar.zst cuberite-59b8205f02eb7bf2954acba56fd63f485a30ece5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/Socket.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/OSSupport/Socket.cpp b/src/OSSupport/Socket.cpp index d80c9bb3d..4226a7535 100644 --- a/src/OSSupport/Socket.cpp +++ b/src/OSSupport/Socket.cpp @@ -105,58 +105,6 @@ void cSocket::ShutdownReadWrite(void) - -AString cSocket::GetErrorString( int a_ErrNo ) -{ - char buffer[ 1024 ]; - AString Out; - - #ifdef _WIN32 - - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, a_ErrNo, 0, buffer, ARRAYCOUNT(buffer), NULL); - Printf(Out, "%d: %s", a_ErrNo, buffer); - if (!Out.empty() && (Out[Out.length() - 1] == '\n')) - { - Out.erase(Out.length() - 2); - } - return Out; - - #else // _WIN32 - - // According to http://linux.die.net/man/3/strerror_r there are two versions of strerror_r(): - - #if ( _GNU_SOURCE ) && !defined(ANDROID_NDK) // GNU version of strerror_r() - - char * res = strerror_r( errno, buffer, ARRAYCOUNT(buffer) ); - if( res != NULL ) - { - Printf(Out, "%d: %s", a_ErrNo, res); - return Out; - } - - #else // XSI version of strerror_r(): - - int res = strerror_r( errno, buffer, ARRAYCOUNT(buffer) ); - if( res == 0 ) - { - Printf(Out, "%d: %s", a_ErrNo, buffer); - return Out; - } - - #endif // strerror_r() version - - else - { - Printf(Out, "Error %d while getting error string for error #%d!", errno, a_ErrNo); - return Out; - } - - #endif // else _WIN32 -} - - - - int cSocket::GetLastError() { #ifdef _WIN32 |