Skip to content

Commit

Permalink
Merge pull request #3143 from sepalani/fixWSAGetLastError
Browse files Browse the repository at this point in the history
WSAGetLastError: fix return value
  • Loading branch information
Parlane committed Oct 5, 2015
2 parents 5d1f78d + 8efd5d1 commit 6aa230c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Source/Core/Core/IPC_HLE/WII_Socket.cpp
Expand Up @@ -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
s32 errorCode = WSAGetLastError();
Expand All @@ -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",
caller.c_str(), errorCode, DecodeError(errorCode), ret);
caller, errorCode, DecodeError(errorCode), ret);

s32 ReturnValue = TranslateErrorCode(errorCode, isRW);
WiiSockMan::GetInstance().SetLastNetError(ReturnValue);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IPC_HLE/WII_Socket.h
Expand Up @@ -201,7 +201,7 @@ class WiiSocket
class WiiSockMan : public ::NonCopyable
{
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 WiiSockMan& GetInstance()
Expand Down

0 comments on commit 6aa230c

Please sign in to comment.