summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikko Koppanen <mkoppanen@php.net>2011-10-26 11:26:00 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-10-26 11:26:00 +0200
commit6c1b50cfab1529e866e40c037ce1be7027423af0 (patch)
tree2c970852a5792cf35c7290fdda2337ba279f414c /src
parentd31792e652cc9fd3bc84e2abd89f232d273b7ede (diff)
Added compile-time test for SOCK_CLOEXEC
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
Diffstat (limited to 'src')
-rw-r--r--src/ip.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ip.cpp b/src/ip.cpp
index b11a244..8090a8a 100644
--- a/src/ip.cpp
+++ b/src/ip.cpp
@@ -40,7 +40,7 @@ zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_)
{
// Setting this option result in sane behaviour when exec() functions
// are used. Old sockets are closed and don't block TCP ports etc.
-#if defined SOCK_CLOEXEC
+#if defined ZMQ_HAVE_SOCK_CLOEXEC
type_ |= SOCK_CLOEXEC;
#endif
@@ -51,7 +51,7 @@ zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_)
// If there's no SOCK_CLOEXEC, let's try the second best option. Note that
// race condition can cause socket not to be closed (if fork happens
// between socket creation and this point).
-#if !defined SOCK_CLOEXEC && defined FD_CLOEXEC
+#if !defined ZMQ_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC
int rc = fcntl (s, F_SETFD, FD_CLOEXEC);
errno_assert (rc != -1);
#endif