[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
This commit is contained in:
Glenn Strauss 2016-10-30 16:04:56 -04:00
parent ca074babb1
commit f59ff32fd9
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@
#include <stdio.h>
#include <fcntl.h>
#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) \