diff options
author | James Almer <jamrial@gmail.com> | 2013-05-16 19:10:28 -0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-17 00:38:07 +0200 |
commit | 54372848f3276ad88cd5b224ce22df343e10d513 (patch) | |
tree | bf2e8246c290434d418e05e3ea603a9020eb0066 /tools/ffhash.c | |
parent | ab074ab9fef8e218f922725ae1e54d0e61661de8 (diff) | |
download | ffmpeg-54372848f3276ad88cd5b224ce22df343e10d513.tar.gz |
tools/ffhash: Use O_BINARY when available
This fixes reading files in Windows
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'tools/ffhash.c')
-rw-r--r-- | tools/ffhash.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/ffhash.c b/tools/ffhash.c index 99b928de27..8c4a9f1b0b 100644 --- a/tools/ffhash.c +++ b/tools/ffhash.c @@ -71,10 +71,13 @@ static void finish(void) static int check(char *file) { uint8_t buffer[SIZE]; - int fd; + int fd, flags = O_RDONLY; int ret = 0; - if (file) fd = open(file, O_RDONLY); +#ifdef O_BINARY + flags |= O_BINARY; +#endif + if (file) fd = open(file, flags); else fd = 0; if (fd == -1) { printf("%s=OPEN-FAILED: %s:", av_hash_get_name(hash), strerror(errno)); |