diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-16 21:24:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-16 21:51:28 +0200 |
commit | 797c2ef97036bb1e5546e27132af9900168066e5 (patch) | |
tree | 538987cb0731d968e85ec089fa77fe7a86d87f6a /libavutil/file.c | |
parent | 9329d36a3a7f3371e8a9279662c78e62ad9c7e2c (diff) | |
download | ffmpeg-797c2ef97036bb1e5546e27132af9900168066e5.tar.gz |
av_tempfile: try tempnam(NULL) first
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/file.c')
-rw-r--r-- | libavutil/file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/file.c b/libavutil/file.c index c388523d1b..44d2ca444a 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); |