Commit f04d7e60 authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

Merge remote branch 'sjmurdoch/cloexec' into cloexec

parents 38da44cb 15f2b785
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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();