Since commit
009c9b76361 the tool was always returning an error
condition when the last entry was read from the meter. This is not
correct as reading the last entry is not an error condition.
Unfortunately it is not know how to detect the lack of entries from
the device from the last read entry. Therefore, in case we fail to
read proper data from the device, we will always assume we were able
to read all entries.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
while (1) {
ret = contour_read_entry(fd, usage_code, &msg);
if (ret < 45)
- return -1;
+ break;
ret = format_message(opts, &msg, ret);
if (ret < 0)