fix failure of open to read variadic mode argument for O_TMPFILE
[musl] / src / fcntl / open.c
index 5e5be1d..3928a6e 100644 (file)
@@ -7,7 +7,7 @@ int open(const char *filename, int flags, ...)
 {
        mode_t mode = 0;
 
-       if (flags & O_CREAT) {
+       if ((flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE) {
                va_list ap;
                va_start(ap, flags);
                mode = va_arg(ap, mode_t);