git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(from parent 1:
47bb141
)
replace 3 separate calls to WSAGetLastError() with 1
265/head
author
Philip Kaufmann
<phil.kaufmann@t-online.de>
Sun, 22 Jun 2014 18:17:15 +0000 (20:17 +0200)
committer
fsb4000
<fsb4000@yandex.ru>
Sat, 16 Jan 2016 13:51:00 +0000 (19:51 +0600)
src/netbase.cpp
patch
|
blob
|
history
diff --git
a/src/netbase.cpp
b/src/netbase.cpp
index
1e7172e
..
00e4bfd
100644
(file)
--- a/
src/netbase.cpp
+++ b/
src/netbase.cpp
@@
-359,8
+359,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;