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 65d2c1c845..d5b3afe530 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);
 }