Fix return value checking of fread() in iolog.c
authorRebecca Cran <rebecca@bluestop.org>
Wed, 4 Apr 2018 23:18:42 +0000 (17:18 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 5 Apr 2018 01:18:50 +0000 (19:18 -0600)
commit2b8b8f0dccb4c7e97aee3b7d7e13d8528467d64e
treebe69b51020197332b2e135edc24d358863e1a0ad
parentdfd3fe1adfe3b018c837f95ad4c4bb8e28d3d42c
Fix return value checking of fread() in iolog.c

According to http://pubs.opengroup.org/onlinepubs/7908799/xsh/fread.html
fread() returns a size_t, not ssize_t, and returns a value of 0 on
both eof and an error. Therefore, check both feof() and ferror() to
determine whether the call succeeded.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
iolog.c