From a961521a86c439ab2ba1073daa6392a069903db1 Mon Sep 17 00:00:00 2001 From: Steven Murdoch Date: Wed, 1 Dec 2010 15:43:17 +0000 Subject: [PATCH] Check that FD_CLOEXEC is set before using it I don't know if any platforms we care about don't have FD_CLOEXEC, but this is what we do elsewhere --- src/common/compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/compat.c b/src/common/compat.c index 56315e5079..123a1ea241 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -1026,7 +1026,7 @@ tor_socketpair(int family, int type, int protocol, int fd[2]) #endif r = socketpair(family, type, protocol, fd); if (r == 0) { -#ifndef SOCK_CLOEXEC +#if !defined(SOCK_CLOEXEC) && defined(FD_CLOEXEC) if (fd[0] >= 0) fcntl(fd[0], F_SETFD, FD_CLOEXEC); if (fd[1] >= 0)