Merge pull request #3143 from sepalani/fixWSAGetLastError

WSAGetLastError: fix return value
This commit is contained in:
Matthew Parlane 2015-10-06 12:08:10 +13:00
commit 6aa230c247
2 changed files with 4 additions and 3 deletions

View File

@ -81,7 +81,8 @@ static s32 TranslateErrorCode(s32 native_error, bool isRW)
} }
} }
s32 WiiSockMan::GetNetErrorCode(s32 ret, const std::string& caller, bool isRW) // Don't use string! (see https://github.com/dolphin-emu/dolphin/pull/3143)
s32 WiiSockMan::GetNetErrorCode(s32 ret, const char* caller, bool isRW)
{ {
#ifdef _WIN32 #ifdef _WIN32
s32 errorCode = WSAGetLastError(); s32 errorCode = WSAGetLastError();
@ -96,7 +97,7 @@ s32 WiiSockMan::GetNetErrorCode(s32 ret, const std::string& caller, bool isRW)
} }
INFO_LOG(WII_IPC_NET, "%s failed with error %d: %s, ret= %d", INFO_LOG(WII_IPC_NET, "%s failed with error %d: %s, ret= %d",
caller.c_str(), errorCode, DecodeError(errorCode), ret); caller, errorCode, DecodeError(errorCode), ret);
s32 ReturnValue = TranslateErrorCode(errorCode, isRW); s32 ReturnValue = TranslateErrorCode(errorCode, isRW);
WiiSockMan::GetInstance().SetLastNetError(ReturnValue); WiiSockMan::GetInstance().SetLastNetError(ReturnValue);

View File

@ -201,7 +201,7 @@ public:
class WiiSockMan : public ::NonCopyable class WiiSockMan : public ::NonCopyable
{ {
public: public:
static s32 GetNetErrorCode(s32 ret, const std::string& caller, bool isRW); static s32 GetNetErrorCode(s32 ret, const char* caller, bool isRW);
static char* DecodeError(s32 ErrorCode); static char* DecodeError(s32 ErrorCode);
static WiiSockMan& GetInstance() static WiiSockMan& GetInstance()