소스 검색

Merge remote branch 'sjmurdoch/cloexec' into cloexec

Nick Mathewson 15 년 전
부모
커밋
f04d7e6009
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/common/compat.c

+ 2 - 1
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();