[FFmpeg-cvslog] av_tempfile: try tempnam(NULL) first

Michael Niedermayer git at videolan.org
Sun Oct 16 21:55:12 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 16 21:24:12 2011 +0200| [797c2ef97036bb1e5546e27132af9900168066e5] | committer: Michael Niedermayer

av_tempfile: try tempnam(NULL) first

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=797c2ef97036bb1e5546e27132af9900168066e5
---

 libavutil/file.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavutil/file.c b/libavutil/file.c
index c388523..44d2ca4 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -133,7 +133,9 @@ void av_file_unmap(uint8_t *bufptr, size_t size)
 int av_tempfile(const char *prefix, char **filename) {
     int fd=-1;
 #if !HAVE_MKSTEMP
-    void *ptr= tempnam(".", prefix);
+    void *ptr= tempnam(NULL, prefix);
+    if(!ptr)
+        ptr= tempnam(".", prefix);
     *filename = av_strdup(ptr);
 #undef free
     free(ptr);



More information about the ffmpeg-cvslog mailing list