aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/open.c4
-rw-r--r--sysdeps/mach/hurd/openat.c4
-rw-r--r--sysdeps/posix/open64.c4
-rw-r--r--sysdeps/unix/sysv/linux/dl-openat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/open.c6
-rw-r--r--sysdeps/unix/sysv/linux/generic/open64.c4
-rw-r--r--sysdeps/unix/sysv/linux/open64.c4
-rw-r--r--sysdeps/unix/sysv/linux/openat.c6
8 files changed, 17 insertions, 17 deletions
diff --git a/sysdeps/mach/hurd/open.c b/sysdeps/mach/hurd/open.c
index 2d1415af6e..c497a7cb44 100644
--- a/sysdeps/mach/hurd/open.c
+++ b/sysdeps/mach/hurd/open.c
@@ -22,7 +22,7 @@
#include <hurd.h>
#include <hurd/fd.h>
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
+/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
__libc_open (const char *file, int oflag, ...)
@@ -30,7 +30,7 @@ __libc_open (const char *file, int oflag, ...)
mode_t mode;
io_t port;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
diff --git a/sysdeps/mach/hurd/openat.c b/sysdeps/mach/hurd/openat.c
index 0928dff624..0d3e138890 100644
--- a/sysdeps/mach/hurd/openat.c
+++ b/sysdeps/mach/hurd/openat.c
@@ -26,7 +26,7 @@
#include <hurd/fd.h>
/* Open FILE with access OFLAG. Interpret relative paths relative to
- the directory associated with FD. If OFLAG includes O_CREAT, a
+ the directory associated with FD. If O_CREAT or O_TMPFILE is in OFLAG, a
third argument is the file protection. */
int
__openat (fd, file, oflag)
@@ -37,7 +37,7 @@ __openat (fd, file, oflag)
mode_t mode;
io_t port;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
diff --git a/sysdeps/posix/open64.c b/sysdeps/posix/open64.c
index 8f8dc60e24..74f669f408 100644
--- a/sysdeps/posix/open64.c
+++ b/sysdeps/posix/open64.c
@@ -19,14 +19,14 @@
#include <stdarg.h>
#include <sysdep-cancel.h>
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
+/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
__libc_open64 (const char *file, int oflag, ...)
{
int mode = 0;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
diff --git a/sysdeps/unix/sysv/linux/dl-openat64.c b/sysdeps/unix/sysv/linux/dl-openat64.c
index 4dd5ed5c3b..732097dd92 100644
--- a/sysdeps/unix/sysv/linux/dl-openat64.c
+++ b/sysdeps/unix/sysv/linux/dl-openat64.c
@@ -28,7 +28,7 @@ openat64 (dfd, file, oflag)
const char *file;
int oflag;
{
- assert ((oflag & O_CREAT) == 0);
+ assert (!__OPEN_NEEDS_MODE (oflag));
#ifdef __NR_openat
return INLINE_SYSCALL (openat, 3, dfd, file, oflag | O_LARGEFILE);
diff --git a/sysdeps/unix/sysv/linux/generic/open.c b/sysdeps/unix/sysv/linux/generic/open.c
index f15144cc2a..289f57aada 100644
--- a/sysdeps/unix/sysv/linux/generic/open.c
+++ b/sysdeps/unix/sysv/linux/generic/open.c
@@ -22,14 +22,14 @@
#include <stdio.h>
#include <sysdep-cancel.h>
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
+/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
__libc_open (const char *file, int oflag, ...)
{
int mode = 0;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
@@ -59,7 +59,7 @@ __open_nocancel (const char *file, int oflag, ...)
{
int mode = 0;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
diff --git a/sysdeps/unix/sysv/linux/generic/open64.c b/sysdeps/unix/sysv/linux/generic/open64.c
index 4feedbaff5..374e41cf3a 100644
--- a/sysdeps/unix/sysv/linux/generic/open64.c
+++ b/sysdeps/unix/sysv/linux/generic/open64.c
@@ -22,14 +22,14 @@
#include <stdio.h>
#include <sysdep-cancel.h>
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
+/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
__libc_open64 (const char *file, int oflag, ...)
{
int mode = 0;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c
index 0067601283..d3ab813ab6 100644
--- a/sysdeps/unix/sysv/linux/open64.c
+++ b/sysdeps/unix/sysv/linux/open64.c
@@ -21,14 +21,14 @@
#include <stdio.h>
#include <sysdep-cancel.h>
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
+/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
__libc_open64 (const char *file, int oflag, ...)
{
int mode = 0;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);
diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c
index 5145823b8e..30d8e6e1ac 100644
--- a/sysdeps/unix/sysv/linux/openat.c
+++ b/sysdeps/unix/sysv/linux/openat.c
@@ -54,13 +54,13 @@ OPENAT_NOT_CANCEL (int fd, const char *file, int oflag, mode_t mode)
/* Open FILE with access OFLAG. Interpret relative paths relative to
- the directory associated with FD. If OFLAG includes O_CREAT, a
- third argument is the file protection. */
+ the directory associated with FD. If OFLAG includes O_CREAT or
+ O_TMPFILE, a fourth argument is the file protection. */
int
__OPENAT (int fd, const char *file, int oflag, ...)
{
mode_t mode = 0;
- if (oflag & O_CREAT)
+ if (__OPEN_NEEDS_MODE (oflag))
{
va_list arg;
va_start (arg, oflag);