projects
/
blktrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27223f1
)
[PATCH] blkrawverify: Check for EOF in error reporting
author
Jens Axboe
<axboe@suse.de>
Sat, 28 Jan 2006 19:39:11 +0000
(20:39 +0100)
committer
Jens Axboe
<axboe@suse.de>
Sat, 28 Jan 2006 19:39:11 +0000
(20:39 +0100)
A check of fread returning 0 is not sufficient towards determining an.
error - 0 also indicates EOF. Added check for that.
blkrawverify.c
patch
|
blob
|
blame
|
history
diff --git
a/blkrawverify.c
b/blkrawverify.c
index 79fa56778d488ffe061e34f0a159d09cf9cf2536..9ed1f8baa9dc1a7fa78e3a3d11238c2ba0b88a4e 100644
(file)
--- 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);