ignore access mode bits of flags in mkostemps and functions that use it
[musl] / src / temp / mkostemps.c
index 7f8492a..512b5f1 100644 (file)
@@ -15,6 +15,7 @@ int __mkostemps(char *template, int len, int flags)
                return -1;
        }
 
+       flags -= flags & O_ACCMODE;
        int fd, retries = 100;
        do {
                __randname(template+l-len-6);