mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-07 14:37:36 +01:00
Close file descriptors on exec (issue 218)
When exec is executed to start a different process image old 0MQ file descriptors could stay open, thus blocking TCP ports and alike. This patch should solve the problem. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "session.hpp"
|
||||
#include "config.hpp"
|
||||
#include "err.hpp"
|
||||
#include "ip.hpp"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -108,7 +109,7 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
|
||||
return -1;
|
||||
|
||||
// Create a listening socket.
|
||||
s = ::socket (AF_UNIX, SOCK_STREAM, 0);
|
||||
s = open_socket (AF_UNIX, SOCK_STREAM, 0);
|
||||
if (s == -1)
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user