From f59ff32fd9af633be3dabe280082a41ff99fd21b Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sun, 30 Oct 2016 16:04:56 -0400 Subject: [PATCH] [mod_cgi] FreeBSD 9.3 does not have pipe2() FreeBSD 9.3 has O_CLOEXEC, but does not have pipe2() until FreeBSD 10. FreeBSD 10 also adds F_DUPFD_CLOEXEC, so use that as indicator https://wiki.freebsd.org/AtomicCloseOnExec Note: FreeBSD 9.3 will soon reach its "extended" EOL date (31 Dec 2016), so those using FreeBSD 9.3 should consider upgrading. https://www.freebsd.org/security/security.html#sup --- src/mod_cgi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod_cgi.c b/src/mod_cgi.c index 8b0dd3ed..64d3b129 100644 --- a/src/mod_cgi.c +++ b/src/mod_cgi.c @@ -36,7 +36,7 @@ #include #include -#ifdef O_CLOEXEC +#if defined(O_CLOEXEC) && (!defined(__FreeBSD__) || defined(F_DUPFD_CLOEXEC)) #define pipe_cloexec(pipefd) pipe2((pipefd), O_CLOEXEC) #elif defined FD_CLOEXEC #define pipe_cloexec(pipefd) \