Browse Source

av_tempfile: dont try the current directory with mkstemp() unless we are on windows

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.9
Michael Niedermayer 14 years ago
parent
commit
fd6af5375b
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavutil/file.c

+ 2
- 0
libavutil/file.c View File

@@ -160,10 +160,12 @@ int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_c
#else
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
fd = mkstemp(*filename);
#ifdef _WIN32
if (fd < 0) {
snprintf(*filename, len, "./%sXXXXXX", prefix);
fd = mkstemp(*filename);
}
#endif
#endif
/* -----common section-----*/
if (fd < 0) {


Loading…
Cancel
Save