mirror of https://git.ffmpeg.org/ffmpeg.git
av_tempfile: fix error codes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4105335c98
commit
482aabd59a
|
@ -146,7 +146,7 @@ int av_tempfile(const char *prefix, char **filename) {
|
||||||
/* -----common section-----*/
|
/* -----common section-----*/
|
||||||
if (*filename == NULL) {
|
if (*filename == NULL) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
|
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
|
||||||
return -1;
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
#if !HAVE_MKSTEMP
|
#if !HAVE_MKSTEMP
|
||||||
# ifndef O_BINARY
|
# ifndef O_BINARY
|
||||||
|
@ -166,8 +166,9 @@ int av_tempfile(const char *prefix, char **filename) {
|
||||||
#endif
|
#endif
|
||||||
/* -----common section-----*/
|
/* -----common section-----*/
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
int err = AVERROR(errno);
|
||||||
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
|
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
|
||||||
return -1;
|
return err;
|
||||||
}
|
}
|
||||||
return fd; /* success */
|
return fd; /* success */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue