about summary refs log tree commit diff
path: root/io/open_2.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/open_2.c')
-rw-r--r--io/open_2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io/open_2.c b/io/open_2.c
index c07ecdd3bd..f11ebe00bb 100644
--- a/io/open_2.c
+++ b/io/open_2.c
@@ -22,8 +22,8 @@
 int
 __open_2 (const char *file, int oflag)
 {
-  if (oflag & O_CREAT)
-    __fortify_fail ("invalid open call: O_CREAT without mode");
+  if (__OPEN_NEEDS_MODE (oflag))
+    __fortify_fail ("invalid open call: O_CREAT or O_TMPFILE without mode");
 
   return __open (file, oflag);
 }