0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Problem: redundant Windows errno conversion

Solution: in the Windows-specific ifdef in tcp_listener set_address,
check for error and set errno only after the IPv4 fallback has failed
too, to avoid setting errno when the socket creation succeeds through
the fallback.
This commit is contained in:
Luca Boccassi 2016-04-07 13:17:08 +01:00
parent 6892b7b60d
commit 0c66618e40

View File

@ -153,10 +153,6 @@ int zmq::tcp_listener_t::set_address (const char *addr_)
// Create a listening socket.
s = open_socket (address.family (), SOCK_STREAM, IPPROTO_TCP);
#ifdef ZMQ_HAVE_WINDOWS
if (s == INVALID_SOCKET)
errno = wsa_error_to_errno (WSAGetLastError ());
#endif
// IPv6 address family not supported, try automatic downgrade to IPv4.
if (s == -1 && address.family () == AF_INET6