aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-16 15:44:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-16 17:12:37 +0200
commit5746f910362f888ecb00efb0a3706ac2ee484019 (patch)
tree079f6dd4b939d86371602b3dc76b0dab558fffb6
parentc9833fc33a493b97f675ca666ea314aadae4b7d6 (diff)
downloadffmpeg-5746f910362f888ecb00efb0a3706ac2ee484019.tar.gz
av_tempfile: handle missing O_BINARY
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/file.c b/libavutil/file.c
index 7be095b1f4..c388523d1b 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -147,6 +147,9 @@ int av_tempfile(const char *prefix, char **filename) {
return -1;
}
#if !HAVE_MKSTEMP
+# ifndef O_BINARY
+# define O_BINARY 0
+# endif
fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
#else
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);