提交 54372848 编写于 作者: J James Almer 提交者: Michael Niedermayer

tools/ffhash: Use O_BINARY when available

This fixes reading files in Windows
Signed-off-by: NJames Almer <jamrial@gmail.com>
Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 ab074ab9
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册