From 0d76cc50c3fc819f3af93c4046365f38789e7fc3 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 23 Jul 2012 18:01:28 +0300 Subject: [PATCH] Do not return error if no more entries are read 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 --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 449fa15..f0faa44 100644 --- a/main.c +++ b/main.c @@ -117,7 +117,7 @@ static int dump_entries(struct user_options *opts, int fd, int usage_code) 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) -- 2.44.0