libredirect: fix build on darwin

Fix build failure on darwin due to absence of `O_TMPFILE`.
This commit is contained in:
Mario Rodas 2020-01-23 20:20:20 -05:00
parent 385b9aee08
commit c3ccac15eb
No known key found for this signature in database
GPG key ID: 4C4BEFD7B18DC5E8

View file

@ -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 -