From 0c66618e405169dcd9f622775c40711c32e93854 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 7 Apr 2016 13:17:08 +0100 Subject: [PATCH] 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. --- src/tcp_listener.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp index fe929a8e..b41d0b3c 100644 --- a/src/tcp_listener.cpp +++ b/src/tcp_listener.cpp @@ -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