1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-10-25 16:12:16 +02:00
parent e7513e1286
commit 39a7ded22d

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)