summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2015-05-11 15:01:37 -0300
committerLennart Poettering <lennart@poettering.net>2015-05-13 14:07:26 +0200
commita765f3443f7d646b3a84dcac491be98ae7537ee4 (patch)
tree58ab0ba52b4a76eb0a03a5e9f0440feaaad34a62 /src
parent91077af69e4eb5f7631e25a2bc5ae8e3c9c08178 (diff)
shared: Use O_EXCL with O_TMPFILE in open_tmpfile
In this usecase, the file will never be materialized with linkat().
Diffstat (limited to 'src')
-rw-r--r--src/shared/util.c2
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