Commit e0534643 authored by Martin Hurton's avatar Martin Hurton

Simplify error handling in tcp_connecter

parent 13ef1e4f
......@@ -218,20 +218,17 @@ int zmq::tcp_connecter_t::open ()
if (rc == 0)
return 0;
// Translate other error codes indicating asynchronous connect has been
// Translate error codes indicating asynchronous connect has been
// launched to a uniform EINPROGRESS.
#ifdef ZMQ_HAVE_WINDOWS
if (rc == SOCKET_ERROR && (WSAGetLastError () == WSAEINPROGRESS ||
WSAGetLastError () == WSAEWOULDBLOCK)) {
const int error_code = WSAGetLastError ();
if (error_code == WSAEINPROGRESS || error_code == WSAEWOULDBLOCK)
errno = EINPROGRESS;
return -1;
}
errno = wsa_error_to_errno (WSAGetLastError ());
else
errno = wsa_error_to_errno (error_code);
#else
if (rc == -1 && errno == EINTR) {
if (errno == EINTR)
errno = EINPROGRESS;
return -1;
}
#endif
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment