diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-11-21 17:01:30 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-11-21 17:01:30 -0500 |
commit | f04d7e6009e0ac739de62aed94b52d5361fae927 (patch) | |
tree | b71bb11fbbe62218f369f937b255685f355ef3f3 | |
parent | 38da44cbf4b5cfe0802c1647c0efc6f2aeb0e821 (diff) | |
parent | 15f2b7859bbf66ca74cc240e89ba02c81d95cb02 (diff) | |
download | tor-f04d7e6009e0ac739de62aed94b52d5361fae927.tar.gz tor-f04d7e6009e0ac739de62aed94b52d5361fae927.zip |
Merge remote branch 'sjmurdoch/cloexec' into cloexec
-rw-r--r-- | src/common/compat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 07d961812c..56315e5079 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -935,11 +935,12 @@ tor_open_socket(int domain, int type, int protocol) { int s; #ifdef SOCK_CLOEXEC +#define LINUX_CLOEXEC_OPEN_SOCKET type |= SOCK_CLOEXEC; #endif s = socket(domain, type, protocol); if (s >= 0) { -#ifdef FD_CLOEXEC +#if !defined(LINUX_CLOEXEC_OPEN_SOCKET) && defined(FD_CLOEXEC) fcntl(s, F_SETFD, FD_CLOEXEC); #endif socket_accounting_lock(); |