summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2015-05-11 15:01:37 -0300
committerSven Eden <yamakuzure@gmx.net>2017-03-14 08:54:18 +0100
commiteba20c2f8afe24a8bab713946a248b45dd2a80f1 (patch)
treef4d0bbb0ee1e36009ec25effe27e3a2757330b31 /src/shared/util.c
parent96dffb0ab5a11ae32a6ab28feae22b4ebb5a3d93 (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/shared/util.c')
-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 e36389eac..275fdece1 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4839,7 +4839,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