chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shared: Use O_EXCL with O_TMPFILE in open_tmpfile
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index e36389eaceac7c10fabf1ab44bab051c8178deed..275fdece1e70de1d9534179a925d191f8fa1ae5c 100644
(file)
--- 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 */
#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
if (fd >= 0)
return fd;
#endif