summaryrefslogtreecommitdiff
path: root/blkrawverify.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-05-08 07:13:39 +0200
committerJens Axboe <axboe@suse.de>2006-05-08 07:13:39 +0200
commit1452478f2d1b27916c7cba6e3976ed2129533c73 (patch)
treeacce8634d28a1721ed3355ce4f746e88fceb512a /blkrawverify.c
parent6a6d3f0f61a8325b4d986e25bb0a61a82ca79e57 (diff)
downloadblktrace-1452478f2d1b27916c7cba6e3976ed2129533c73.tar.gz
blktrace-1452478f2d1b27916c7cba6e3976ed2129533c73.tar.bz2
[PATCH] fread/fwrite error handling
Need to check ferror(), not return value. Thanks to Alex Polvi.
Diffstat (limited to 'blkrawverify.c')
-rw-r--r--blkrawverify.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/blkrawverify.c b/blkrawverify.c
index ca82707..93e8efa 100644
--- a/blkrawverify.c
+++ b/blkrawverify.c
@@ -169,6 +169,11 @@ static int process(FILE **fp, char *devname, char *file, unsigned int cpu)
ofp = *fp;
while ((n = fread(bit, sizeof(struct blk_io_trace), 1, ifp)) == 1) {
+ if (ferror(ifp)) {
+ clearerr(ifp);
+ perror("fread");
+ break;
+ }
if (data_is_native == -1)
check_data_endianness(bit->magic);