av_tempfile: try tempnam(NULL) first

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-10-16 21:24:12 +02:00
parent 9329d36a3a
commit 797c2ef970

View File

@ -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);