[FFmpeg-cvslog] r9596 - in trunk: configure libavcodec/utils.c
ramiro
subversion
Wed Jul 11 15:57:23 CEST 2007
Author: ramiro
Date: Wed Jul 11 15:57:22 2007
New Revision: 9596
Log:
Proper check for mkstemp().
Modified:
trunk/configure
trunk/libavcodec/utils.c
Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Wed Jul 11 15:57:22 2007
@@ -673,6 +673,7 @@ HAVE_LIST="
machine_ioctl_meteor_h
malloc_h
memalign
+ mkstemp
mlib
ppc64
sdl
@@ -1507,6 +1508,8 @@ fi
check_header byteswap.h
+check_func mkstemp
+
check_header arpa/inet.h
check_func inet_aton
Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c (original)
+++ trunk/libavcodec/utils.c Wed Jul 11 15:57:22 2007
@@ -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 @@ unsigned int av_xiphlacing(unsigned char
* 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 @@ int av_tempfile(char *prefix, char **fil
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);
More information about the ffmpeg-cvslog
mailing list