OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
797c2ef
)
av_tempfile: use O_EXCL
author
Michael Niedermayer
<michaelni@gmx.at>
Sun, 16 Oct 2011 19:25:07 +0000
(21:25 +0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Sun, 16 Oct 2011 19:51:28 +0000
(21:51 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/file.c
patch
|
blob
|
history
diff --git
a/libavutil/file.c
b/libavutil/file.c
index
44d2ca4
..
e73e8ef
100644
(file)
--- a/
libavutil/file.c
+++ b/
libavutil/file.c
@@
-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);