summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-16 21:27:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-16 21:51:28 +0200
commit482aabd59a9da807e88fc7796b0764290b62cf11 (patch)
tree7aab740ecd31015654d282eb0e7d8a1101c2a4e4 /libavutil
parent4105335c98dfafa848fd025f5b3ca4e7b8964d27 (diff)
av_tempfile: fix error codes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavutil/file.c b/libavutil/file.c
index e73e8efd0e..e2cfc2f1dd 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -146,7 +146,7 @@ int av_tempfile(const char *prefix, char **filename) {
/* -----common section-----*/
if (*filename == NULL) {
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
- return -1;
+ return AVERROR(ENOMEM);
}
#if !HAVE_MKSTEMP
# ifndef O_BINARY
@@ -166,8 +166,9 @@ int av_tempfile(const char *prefix, char **filename) {
#endif
/* -----common section-----*/
if (fd < 0) {
+ int err = AVERROR(errno);
av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
- return -1;
+ return err;
}
return fd; /* success */
}