Skip to content

Commit adaf0dd

Browse files
committed
MDEV-26601: mysys - O_TMPFILE ^ O_CREAT
Thanks to Fabian Vogt for noticing the mutual exclusions of these open flags on tmpfs caused by mariadb opening it incorrectly. As such we clear the O_CREAT flag while opening it as O_TMPFILE.
1 parent 5527fc5 commit adaf0dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mysys/mf_tempfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
121121
/* explictly don't use O_EXCL here has it has a different
122122
meaning with O_TMPFILE
123123
*/
124-
if ((file= open(dir, mode | O_TMPFILE | O_CLOEXEC,
124+
if ((file= open(dir, (mode & ~O_CREAT) | O_TMPFILE | O_CLOEXEC,
125125
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)) >= 0)
126126
{
127127
my_snprintf(to, FN_REFLEN, "%s/#sql/fd=%d", dir, file);

0 commit comments

Comments
 (0)