Problem: -1 used for invalid socket

Solution: use retired_fd instead
parent aa29f7ca
...@@ -115,7 +115,7 @@ int zmq::ipc_connecter_t::open () ...@@ -115,7 +115,7 @@ int zmq::ipc_connecter_t::open ()
// Create the socket. // Create the socket.
_s = open_socket (AF_UNIX, SOCK_STREAM, 0); _s = open_socket (AF_UNIX, SOCK_STREAM, 0);
if (_s == -1) if (_s == retired_fd)
return -1; return -1;
// Set the non-blocking flag. // Set the non-blocking flag.
......
...@@ -116,7 +116,7 @@ int zmq::tipc_connecter_t::open () ...@@ -116,7 +116,7 @@ int zmq::tipc_connecter_t::open ()
} }
// Create the socket. // Create the socket.
_s = open_socket (AF_TIPC, SOCK_STREAM, 0); _s = open_socket (AF_TIPC, SOCK_STREAM, 0);
if (_s == -1) if (_s == retired_fd)
return -1; return -1;
// Set the non-blocking flag. // Set the non-blocking flag.
......
...@@ -102,7 +102,7 @@ int zmq::tipc_listener_t::set_local_address (const char *addr_) ...@@ -102,7 +102,7 @@ int zmq::tipc_listener_t::set_local_address (const char *addr_)
// Create a listening socket. // Create a listening socket.
_s = open_socket (AF_TIPC, SOCK_STREAM, 0); _s = open_socket (AF_TIPC, SOCK_STREAM, 0);
if (_s == -1) if (_s == retired_fd)
return -1; return -1;
// If random Port Identity, update address object to reflect the assigned address // If random Port Identity, update address object to reflect the assigned address
......
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