From c3ccac15eb0afb1730e995748167d5e34038ccdb Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 23 Jan 2020 20:20:20 -0500 Subject: [PATCH] libredirect: fix build on darwin Fix build failure on darwin due to absence of `O_TMPFILE`. --- pkgs/build-support/libredirect/libredirect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c index d31b7551e94..e7f74c736ab 100644 --- a/pkgs/build-support/libredirect/libredirect.c +++ b/pkgs/build-support/libredirect/libredirect.c @@ -61,7 +61,11 @@ static const char * rewrite(const char * path, char * buf) static int open_needs_mode(int flags) { +#ifdef O_TMPFILE return (flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE; +#else + return flags & O_CREAT; +#endif } /* The following set of Glibc library functions is very incomplete -