mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 12:56:56 +00:00
av_tempfile: dont try the current directory with mkstemp() unless we are on windows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e8e13358ad
commit
fd6af5375b
@ -160,10 +160,12 @@ int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_c
|
|||||||
#else
|
#else
|
||||||
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
|
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
|
||||||
fd = mkstemp(*filename);
|
fd = mkstemp(*filename);
|
||||||
|
#ifdef _WIN32
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
snprintf(*filename, len, "./%sXXXXXX", prefix);
|
snprintf(*filename, len, "./%sXXXXXX", prefix);
|
||||||
fd = mkstemp(*filename);
|
fd = mkstemp(*filename);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* -----common section-----*/
|
/* -----common section-----*/
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user