Commit fd6af537 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e8e13358
......@@ -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) {
......
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