aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libsandbox/wrapper-funcs/openat.c2
-rw-r--r--localdecls.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/libsandbox/wrapper-funcs/openat.c b/libsandbox/wrapper-funcs/openat.c
index 3e46ad5..846c63f 100644
--- a/libsandbox/wrapper-funcs/openat.c
+++ b/libsandbox/wrapper-funcs/openat.c
@@ -24,7 +24,7 @@
#define WRAPPER_SAFE_POST_EXPAND \
int mode = 0; \
- if (flags & O_CREAT) { \
+ if (flags & (O_CREAT | O_TMPFILE)) { \
va_list ap; \
va_start(ap, flags); \
mode = va_arg(ap, int); \
diff --git a/localdecls.h b/localdecls.h
index be99617..0e11fea 100644
--- a/localdecls.h
+++ b/localdecls.h
@@ -52,6 +52,9 @@
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
#endif
+#ifndef O_TMPFILE
+# define O_TMPFILE 0
+#endif
#if !HAVE_DECL_ENVIRON
extern char **environ;