diff --git a/src/err.cpp b/src/err.cpp index 0c07613c..deabeef5 100644 --- a/src/err.cpp +++ b/src/err.cpp @@ -89,12 +89,12 @@ void zmq::zmq_abort(const char *errmsg_) const char *zmq::wsa_error() { - const int lastError = WSAGetLastError(); + const int last_error = WSAGetLastError(); // TODO: This is not a generic way to handle this... - if (lastError == WSAEWOULDBLOCK) + if (last_error == WSAEWOULDBLOCK) return NULL; - return wsa_error_no (lastError); + return wsa_error_no (last_error); } const char *zmq::wsa_error_no (int no_) diff --git a/src/ip.cpp b/src/ip.cpp index 506ca16d..cf52a556 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -132,11 +132,11 @@ int zmq::get_peer_ip_address (fd_t sockfd_, std::string &ip_addr_) rc = getpeername (sockfd_, (struct sockaddr*) &ss, &addrlen); #ifdef ZMQ_HAVE_WINDOWS if (rc == SOCKET_ERROR) { - const int lastError = WSAGetLastError(); - wsa_assert (lastError != WSANOTINITIALISED && - lastError != WSAEFAULT && - lastError != WSAEINPROGRESS && - lastError != WSAENOTSOCK); + const int last_error = WSAGetLastError(); + wsa_assert (last_error != WSANOTINITIALISED && + last_error != WSAEFAULT && + last_error != WSAEINPROGRESS && + last_error != WSAENOTSOCK); return 0; } #else diff --git a/src/socks_connecter.cpp b/src/socks_connecter.cpp index 087544ea..aac4a060 100644 --- a/src/socks_connecter.cpp +++ b/src/socks_connecter.cpp @@ -368,11 +368,11 @@ int zmq::socks_connecter_t::connect_to_proxy () // Translate error codes indicating asynchronous connect has been // launched to a uniform EINPROGRESS. #ifdef ZMQ_HAVE_WINDOWS - const int lastError = WSAGetLastError(); - if (lastError == WSAEINPROGRESS || lastError == WSAEWOULDBLOCK) + const int last_error = WSAGetLastError(); + if (last_error == WSAEINPROGRESS || last_error == WSAEWOULDBLOCK) errno = EINPROGRESS; else { - errno = wsa_error_to_errno (lastError); + errno = wsa_error_to_errno (last_error); close (); } #else diff --git a/src/tcp.cpp b/src/tcp.cpp index f1edfd07..1a978371 100644 --- a/src/tcp.cpp +++ b/src/tcp.cpp @@ -178,24 +178,24 @@ void zmq::tune_tcp_retransmit_timeout (fd_t sockfd_, int timeout_) // If not a single byte can be written to the socket in non-blocking mode // we'll get an error (this may happen during the speculative write). - const int lastError = WSAGetLastError(); - if (nbytes == SOCKET_ERROR && lastError == WSAEWOULDBLOCK) + const int last_error = WSAGetLastError(); + if (nbytes == SOCKET_ERROR && last_error == WSAEWOULDBLOCK) return 0; // Signalise peer failure. if (nbytes == SOCKET_ERROR && ( - lastError == WSAENETDOWN || - lastError == WSAENETRESET || - lastError == WSAEHOSTUNREACH || - lastError == WSAECONNABORTED || - lastError == WSAETIMEDOUT || - lastError == WSAECONNRESET + last_error == WSAENETDOWN || + last_error == WSAENETRESET || + last_error == WSAEHOSTUNREACH || + last_error == WSAECONNABORTED || + last_error == WSAETIMEDOUT || + last_error == WSAECONNRESET )) return -1; // Circumvent a Windows bug; see https://support.microsoft.com/en-us/kb/201213 // and https://zeromq.jira.com/browse/LIBZMQ-195 - if (nbytes == SOCKET_ERROR && lastError == WSAENOBUFS) + if (nbytes == SOCKET_ERROR && last_error == WSAENOBUFS) return 0; wsa_assert (nbytes != SOCKET_ERROR); @@ -240,19 +240,19 @@ int zmq::tcp_read (fd_t s_, void *data_, size_t size_) // If not a single byte can be read from the socket in non-blocking mode // we'll get an error (this may happen during the speculative read). if (rc == SOCKET_ERROR) { - const int lastError = WSAGetLastError(); - if (lastError == WSAEWOULDBLOCK) { + const int last_error = WSAGetLastError(); + if (last_error == WSAEWOULDBLOCK) { errno = EAGAIN; } else { - wsa_assert (lastError == WSAENETDOWN || - lastError == WSAENETRESET || - lastError == WSAECONNABORTED || - lastError == WSAETIMEDOUT || - lastError == WSAECONNRESET || - lastError == WSAECONNREFUSED || - lastError == WSAENOTCONN); - errno = wsa_error_to_errno (lastError); + wsa_assert (last_error == WSAENETDOWN || + last_error == WSAENETRESET || + last_error == WSAECONNABORTED || + last_error == WSAETIMEDOUT || + last_error == WSAECONNRESET || + last_error == WSAECONNREFUSED || + last_error == WSAENOTCONN); + errno = wsa_error_to_errno (last_error); } } diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index 26e3e261..1255630f 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -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 lastError = WSAGetLastError(); - if (lastError == WSAEINPROGRESS || lastError == WSAEWOULDBLOCK) + const int last_error = WSAGetLastError(); + if (last_error == WSAEINPROGRESS || last_error == WSAEWOULDBLOCK) errno = EINPROGRESS; else - errno = wsa_error_to_errno (lastError); + errno = wsa_error_to_errno (last_error); #else if (errno == EINTR) errno = EINPROGRESS; diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp index 2b32c272..dd1d960d 100644 --- a/src/tcp_listener.cpp +++ b/src/tcp_listener.cpp @@ -278,11 +278,11 @@ zmq::fd_t zmq::tcp_listener_t::accept () #ifdef ZMQ_HAVE_WINDOWS if (sock == INVALID_SOCKET) { - const int lastError = WSAGetLastError(); - wsa_assert (lastError == WSAEWOULDBLOCK || - lastError == WSAECONNRESET || - lastError == WSAEMFILE || - lastError == WSAENOBUFS); + const int last_error = WSAGetLastError(); + wsa_assert (last_error == WSAEWOULDBLOCK || + last_error == WSAECONNRESET || + last_error == WSAEMFILE || + last_error == WSAENOBUFS); return retired_fd; } #if !defined _WIN32_WCE