|
|
@ -112,7 +112,10 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l |
|
|
|
{ |
|
|
|
{ |
|
|
|
FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx }; |
|
|
|
FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx }; |
|
|
|
int fd = -1; |
|
|
|
int fd = -1; |
|
|
|
#if !HAVE_MKSTEMP |
|
|
|
#if HAVE_MKSTEMP |
|
|
|
|
|
|
|
size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ |
|
|
|
|
|
|
|
*filename = av_malloc(len); |
|
|
|
|
|
|
|
#elif HAVE_TEMPNAM |
|
|
|
void *ptr= tempnam(NULL, prefix); |
|
|
|
void *ptr= tempnam(NULL, prefix); |
|
|
|
if(!ptr) |
|
|
|
if(!ptr) |
|
|
|
ptr= tempnam(".", prefix); |
|
|
|
ptr= tempnam(".", prefix); |
|
|
@ -120,8 +123,7 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l |
|
|
|
#undef free |
|
|
|
#undef free |
|
|
|
free(ptr); |
|
|
|
free(ptr); |
|
|
|
#else |
|
|
|
#else |
|
|
|
size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ |
|
|
|
return AVERROR(ENOSYS); |
|
|
|
*filename = av_malloc(len); |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
/* -----common section-----*/ |
|
|
|
/* -----common section-----*/ |
|
|
|
if (!*filename) { |
|
|
|
if (!*filename) { |
|
|
|