changeset 5284:b481b3e3f43d libavcodec

Proper check for mkstemp().
author ramiro
date Wed, 11 Jul 2007 13:57:22 +0000
parents 35e847940db4
children 6661692d34b4
files utils.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Wed Jul 11 13:19:58 2007 +0000
+++ b/utils.c	Wed Jul 11 13:57:22 2007 +0000
@@ -34,7 +34,7 @@
 #include <stdarg.h>
 #include <limits.h>
 #include <float.h>
-#ifdef __MINGW32__
+#if !defined(HAVE_MKSTEMP)
 #include <fcntl.h>
 #endif
 
@@ -1333,7 +1333,7 @@
  * and opened file name in **filename. */
 int av_tempfile(char *prefix, char **filename) {
     int fd=-1;
-#ifdef __MINGW32__
+#if !defined(HAVE_MKSTEMP)
     *filename = tempnam(".", prefix);
 #else
     size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
@@ -1344,7 +1344,7 @@
         av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
         return -1;
     }
-#ifdef __MINGW32__
+#if !defined(HAVE_MKSTEMP)
     fd = open(*filename, _O_RDWR | _O_BINARY | _O_CREAT, 0444);
 #else
     snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);