Commit 4105335c authored by Michael Niedermayer's avatar Michael Niedermayer

av_tempfile: use O_EXCL

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 797c2ef9
......@@ -152,7 +152,10 @@ int av_tempfile(const char *prefix, char **filename) {
# ifndef O_BINARY
# define O_BINARY 0
# endif
fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
# ifndef O_EXCL
# define O_EXCL 0
# endif
fd = open(*filename, O_RDWR | O_BINARY | O_CREAT | O_EXCL, 0444);
#else
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
fd = mkstemp(*filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment