Browse code

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/10/17 05:32:41
Showing 1 changed files
... ...
@@ -160,11 +160,13 @@ int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_c
160 160
 #else
161 161
     snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
162 162
     fd = mkstemp(*filename);
163
+#ifdef _WIN32
163 164
     if (fd < 0) {
164 165
         snprintf(*filename, len, "./%sXXXXXX", prefix);
165 166
         fd = mkstemp(*filename);
166 167
     }
167 168
 #endif
169
+#endif
168 170
     /* -----common section-----*/
169 171
     if (fd < 0) {
170 172
         int err = AVERROR(errno);