From: Michael Niedermayer Date: Sat, 25 Oct 2014 14:12:16 +0000 (+0200) Subject: tools/ffhash: read errno before calling functions which might change it X-Git-Tag: n2.5~798 X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/39a7ded22df3f0bae46706800da6eeede744c14f tools/ffhash: read errno before calling functions which might change it Signed-off-by: Michael Niedermayer --- diff --git a/tools/ffhash.c b/tools/ffhash.c index a9f71c26c5..6942527732 100644 --- a/tools/ffhash.c +++ b/tools/ffhash.c @@ -94,9 +94,10 @@ static int check(char *file) for (;;) { int size = read(fd, buffer, SIZE); if (size < 0) { + int err = errno; close(fd); finish(); - printf("+READ-FAILED: %s", strerror(errno)); + printf("+READ-FAILED: %s", strerror(err)); ret = 2; goto end; } else if(!size)