av_tempfile: handle missing O_BINARY
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Oct 2011 13:44:31 +0000 (15:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Oct 2011 15:12:37 +0000 (17:12 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/file.c

index 7be095b..c388523 100644 (file)
@@ -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);