aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <[email protected]>2014-06-22 20:17:15 +0200
committerPhilip Kaufmann <[email protected]>2014-06-24 08:46:12 +0200
commit6dc90ed8fa34db164fac956eed600b2ba66640a0 (patch)
tree621b7ae1562c685924fd8619e66d4b19a2cd13c0 /src/netbase.cpp
parentMerge pull request #4395 (diff)
downloaddiscoin-6dc90ed8fa34db164fac956eed600b2ba66640a0.tar.xz
discoin-6dc90ed8fa34db164fac956eed600b2ba66640a0.zip
replace 3 separate calls to WSAGetLastError() with 1
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp3
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;