summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util.c b/util.c
index 9182a80..aa6f401 100644
--- a/util.c
+++ b/util.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@@ -120,7 +121,7 @@ int dup_cloexec(int fd) {
}
int pipe_cloexec(int pipefd[2]) {
-#if __linux__ || BSD
+#if __linux__ || (BSD && !__APPLE__)
return pipe2(pipefd, O_CLOEXEC);
#else
if (pipe(pipefd) != 0) {