summaryrefslogtreecommitdiff
path: root/blkrawverify.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-01-28 20:39:11 +0100
committerJens Axboe <axboe@suse.de>2006-01-28 20:39:11 +0100
commit05e2c5594c7e5078abbdca1094e0fe6577ad4656 (patch)
treeeaeaa100b82d602a6d9b9a7050229829d18e28f1 /blkrawverify.c
parent27223f197c1694066a489b1153a9127b7ba377b1 (diff)
downloadblktrace-05e2c5594c7e5078abbdca1094e0fe6577ad4656.tar.gz
blktrace-05e2c5594c7e5078abbdca1094e0fe6577ad4656.tar.bz2
[PATCH] blkrawverify: Check for EOF in error reporting
A check of fread returning 0 is not sufficient towards determining an. error - 0 also indicates EOF. Added check for that.
Diffstat (limited to 'blkrawverify.c')
-rw-r--r--blkrawverify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blkrawverify.c b/blkrawverify.c
index 79fa567..9ed1f8b 100644
--- a/blkrawverify.c
+++ b/blkrawverify.c
@@ -199,7 +199,7 @@ static int process(FILE *ofp, char *file, unsigned int cpu)
SWAP_BITS();
}
- if (n == 0)
+ if (n == 0 && !feof(ifp))
fprintf(stderr,"%s: fread failed %d/%s\n",
file, errno, strerror(errno));
fclose(ifp);