summaryrefslogtreecommitdiffstats
path: root/tools/ffhash.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-25 16:12:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-25 16:12:16 +0200
commit39a7ded22df3f0bae46706800da6eeede744c14f (patch)
treedd01e596535a9a11148707c60f8c35fc19576114 /tools/ffhash.c
parente7513e1286ca1b747485f950b0e1c93612b6736c (diff)
downloadffmpeg-streaming-39a7ded22df3f0bae46706800da6eeede744c14f.zip
ffmpeg-streaming-39a7ded22df3f0bae46706800da6eeede744c14f.tar.gz
tools/ffhash: read errno before calling functions which might change it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'tools/ffhash.c')
-rw-r--r--tools/ffhash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/ffhash.c b/tools/ffhash.c
index a9f71c2..6942527 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)
OpenPOWER on IntegriCloud