From 0e0d6c2b46837291273f2e1ef7be62a206a997ef Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 24 Jul 2018 21:15:24 -0400 Subject: util: macOS doesn't have pipe2() The code was testing for BSD, since all the normal BSDs have it. But until recently, wasn't included, so BSD was undefined even on platforms that define it. Now that it is defined appropriately, exclude macOS specifically. --- util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util.c') diff --git a/util.c b/util.c index 9182a80..aa6f401 100644 --- a/util.c +++ b/util.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -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) { -- cgit v1.2.3