summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/open.c2
-rw-r--r--libc/sysdeps/linux/common/open64.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index ccdcf3848..ac09d40f0 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -31,7 +31,7 @@ int open(const char *file, int oflag, ...)
int oldtype, result;
#endif
- if (oflag & O_CREAT) {
+ if (oflag & (O_CREAT | (O_TMPFILE &~ O_DIRECTORY))) {
va_list arg;
va_start(arg, oflag);
mode = va_arg(arg, mode_t);
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index 6e65a988e..9d4c06b18 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -10,13 +10,13 @@
#include <stdarg.h>
#include <cancel.h>
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
+/* Open FILE with access OFLAG. If OFLAG includes O_CREAT or O_TMPFILE,
a third argument is the file protection. */
int open64(const char *file, int oflag, ...)
{
mode_t mode = 0;
- if (oflag & O_CREAT) {
+ if (oflag & (O_CREAT | (O_TMPFILE &~ O_DIRECTORY))) {
va_list arg;
va_start (arg, oflag);
mode = va_arg (arg, mode_t);