av_tempfile: handle missing O_BINARY
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c9833fc33a
commit
5746f91036
@ -147,6 +147,9 @@ int av_tempfile(const char *prefix, char **filename) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#if !HAVE_MKSTEMP
|
#if !HAVE_MKSTEMP
|
||||||
|
# ifndef O_BINARY
|
||||||
|
# define O_BINARY 0
|
||||||
|
# endif
|
||||||
fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
|
fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
|
||||||
#else
|
#else
|
||||||
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
|
snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user