diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-06-25 07:16:20 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-06-25 07:20:42 +0200 |
| commit | 27383b9015e204ac834d5df00737fe23bb042bc4 (patch) | |
| tree | 731f6027bcb84e73b4026f60b78d8f281b0be183 /src/netbase.cpp | |
| parent | Merge pull request #4404 (diff) | |
| parent | replace 3 separate calls to WSAGetLastError() with 1 (diff) | |
| download | discoin-27383b9015e204ac834d5df00737fe23bb042bc4.tar.xz discoin-27383b9015e204ac834d5df00737fe23bb042bc4.zip | |
Merge pull request #4390
6dc90ed replace 3 separate calls to WSAGetLastError() with 1 (Philip Kaufmann)
Diffstat (limited to 'src/netbase.cpp')
| -rw-r--r-- | src/netbase.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 4aa7367f3..3c50174e7 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -337,8 +337,9 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { + int nErr = WSAGetLastError(); // WSAEINVAL is here because some legacy version of winsock uses it - if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL) + if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) { struct timeval timeout; timeout.tv_sec = nTimeout / 1000; |