Browse Source

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.5
Michael Niedermayer 10 years ago
parent
commit
39a7ded22d
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      tools/ffhash.c

+ 2
- 1
tools/ffhash.c View 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)


Loading…
Cancel
Save