remove unnecessary multiple WSAGetLastError() calls

This commit is contained in:
reza.ebrahimi
2015-08-14 16:29:18 +04:30
parent bff2284a50
commit d7b74d1f57
6 changed files with 45 additions and 39 deletions

View File

@@ -319,11 +319,11 @@ int zmq::tcp_connecter_t::open ()
// Translate error codes indicating asynchronous connect has been
// launched to a uniform EINPROGRESS.
#ifdef ZMQ_HAVE_WINDOWS
const int error_code = WSAGetLastError ();
if (error_code == WSAEINPROGRESS || error_code == WSAEWOULDBLOCK)
const int lastError = WSAGetLastError();
if (lastError == WSAEINPROGRESS || lastError == WSAEWOULDBLOCK)
errno = EINPROGRESS;
else
errno = wsa_error_to_errno (error_code);
errno = wsa_error_to_errno (lastError);
#else
if (errno == EINTR)
errno = EINPROGRESS;