summaryrefslogtreecommitdiff
path: root/src/ipc_listener.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-09-02 15:34:12 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-09-02 15:34:12 +0200
commit8b7ac4c2a9c3ede95d6f5f9717a1939a23788964 (patch)
tree9afa85cda119a35f2dcd18eb7ff77e92cb8bd78a /src/ipc_listener.cpp
parent2910a728dc777068e6ae7f67041da185b0865171 (diff)
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>
Diffstat (limited to 'src/ipc_listener.cpp')
-rw-r--r--src/ipc_listener.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ipc_listener.cpp b/src/ipc_listener.cpp
index 1457349..cad58ba 100644
--- a/src/ipc_listener.cpp
+++ b/src/ipc_listener.cpp
@@ -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;