Commit 39a7ded2 authored by Michael Niedermayer's avatar Michael Niedermayer

tools/ffhash: read errno before calling functions which might change it

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e7513e12
...@@ -94,9 +94,10 @@ static int check(char *file) ...@@ -94,9 +94,10 @@ static int check(char *file)
for (;;) { for (;;) {
int size = read(fd, buffer, SIZE); int size = read(fd, buffer, SIZE);
if (size < 0) { if (size < 0) {
int err = errno;
close(fd); close(fd);
finish(); finish();
printf("+READ-FAILED: %s", strerror(errno)); printf("+READ-FAILED: %s", strerror(err));
ret = 2; ret = 2;
goto end; goto end;
} else if(!size) } else if(!size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment