mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
shared: Use O_EXCL with O_TMPFILE in open_tmpfile
In this usecase, the file will never be materialized with linkat().
This commit is contained in:
parent
91077af69e
commit
a765f3443f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user