OSDN Git Service

av_tempfile: dont try the current directory with mkstemp() unless we are on windows
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Oct 2011 20:32:41 +0000 (22:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Oct 2011 20:32:41 +0000 (22:32 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/file.c

index 88f2b52..e59335a 100644 (file)
@@ -160,11 +160,13 @@ 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) {
         int err = AVERROR(errno);