summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2021-09-14 19:07:49 +1000
committerDaniel Black <daniel@mariadb.org>2021-09-14 19:07:56 +1000
commit4f65b187b20756bdac9612754ed6a4f6d322262f (patch)
tree8e67b4cc6dd6f1042d8c7265732aeea5e1cba4fc
parent8958f05e63f2cc059025c821b5cac8e54d8b6c91 (diff)
downloadmariadb-git-bb-10.4-danielblack-MDEV-26601-O_TMPFILE-bugfix.tar.gz
MDEV-26601: mysys - O_TMPFILE ^ O_CREATbb-10.4-danielblack-MDEV-26601-O_TMPFILE-bugfix
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.
-rw-r--r--mysys/mf_tempfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 51a3efa05ad..0f1c6d6b1bc 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -121,7 +121,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
/* explictly don't use O_EXCL here has it has a different
meaning with O_TMPFILE
*/
- if ((file= open(dir, mode | O_TMPFILE | O_CLOEXEC,
+ if ((file= open(dir, (mode & ~O_CREAT) | O_TMPFILE | O_CLOEXEC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)) >= 0)
{
my_snprintf(to, FN_REFLEN, "%s/#sql/fd=%d", dir, file);