From e18772f94220b7625ffe0029cba08ce5bb191018 Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Wed, 29 Apr 2020 17:12:08 +0000 Subject: [PATCH] Problem: -1 used for invalid socket Solution: use retired_fd instead --- src/ipc_connecter.cpp | 2 +- src/tipc_connecter.cpp | 2 +- src/tipc_listener.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ipc_connecter.cpp b/src/ipc_connecter.cpp index 48e06f53..0bd03d58 100644 --- a/src/ipc_connecter.cpp +++ b/src/ipc_connecter.cpp @@ -115,7 +115,7 @@ int zmq::ipc_connecter_t::open () // Create the socket. _s = open_socket (AF_UNIX, SOCK_STREAM, 0); - if (_s == -1) + if (_s == retired_fd) return -1; // Set the non-blocking flag. diff --git a/src/tipc_connecter.cpp b/src/tipc_connecter.cpp index f27d4657..6057997f 100644 --- a/src/tipc_connecter.cpp +++ b/src/tipc_connecter.cpp @@ -116,7 +116,7 @@ int zmq::tipc_connecter_t::open () } // Create the socket. _s = open_socket (AF_TIPC, SOCK_STREAM, 0); - if (_s == -1) + if (_s == retired_fd) return -1; // Set the non-blocking flag. diff --git a/src/tipc_listener.cpp b/src/tipc_listener.cpp index a13c16bd..338327bc 100644 --- a/src/tipc_listener.cpp +++ b/src/tipc_listener.cpp @@ -102,7 +102,7 @@ int zmq::tipc_listener_t::set_local_address (const char *addr_) // Create a listening socket. _s = open_socket (AF_TIPC, SOCK_STREAM, 0); - if (_s == -1) + if (_s == retired_fd) return -1; // If random Port Identity, update address object to reflect the assigned address