diff options
author | Cristian RodrÃguez <crrodriguez@opensuse.org> | 2015-05-11 15:01:37 -0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-05-13 14:07:26 +0200 |
commit | a765f3443f7d646b3a84dcac491be98ae7537ee4 (patch) | |
tree | 58ab0ba52b4a76eb0a03a5e9f0440feaaad34a62 | |
parent | 91077af69e4eb5f7631e25a2bc5ae8e3c9c08178 (diff) |
shared: Use O_EXCL with O_TMPFILE in open_tmpfile
In this usecase, the file will never be materialized
with linkat().
-rw-r--r-- | src/shared/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index de891447e7..466dce439f 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -4838,7 +4838,7 @@ int open_tmpfile(const char *path, int flags) { #ifdef O_TMPFILE /* Try O_TMPFILE first, if it is supported */ - fd = open(path, flags|O_TMPFILE, S_IRUSR|S_IWUSR); + fd = open(path, flags|O_TMPFILE|O_EXCL, S_IRUSR|S_IWUSR); if (fd >= 0) return fd; #endif |