diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-25 07:16:20 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-25 07:20:42 +0200 |
commit | 27383b9015e204ac834d5df00737fe23bb042bc4 (patch) | |
tree | 731f6027bcb84e73b4026f60b78d8f281b0be183 | |
parent | e6cb20e19a79ee0e3d4027c589af82f1d2d5786f (diff) | |
parent | 6dc90ed8fa34db164fac956eed600b2ba66640a0 (diff) |
Merge pull request #4390
6dc90ed replace 3 separate calls to WSAGetLastError() with 1 (Philip Kaufmann)
-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 4aa7367f39..3c50174e75 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; |