Skip to content
Snippets Groups Projects
Commit 39a7ded2 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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

parent e7513e12
No related branches found
No related tags found
No related merge requests found
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment