]> git.itanic.dy.fi Git - log-plotter/commitdiff
Fix read return value check
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 6 Oct 2013 19:58:07 +0000 (22:58 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 6 Oct 2013 19:58:07 +0000 (22:58 +0300)
We wish to check against the return value of read, not the function
pointer..

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
main.c

diff --git a/main.c b/main.c
index e116477dd5d77ba2d731dde0e404ea1f888ff435..6cfdd879d35692e9c5ccbcfa615ecb3dd249dc74 100644 (file)
--- a/main.c
+++ b/main.c
@@ -26,7 +26,7 @@ static int read_log_line(int infd, char *buf, size_t bufsize, int *offset)
        int i;
 
        ret = read(infd, buf + *offset, bufsize - *offset - 1);
-       if (read < 0) {
+       if (ret < 0) {
                pr_err("read: %m\n");
                return -1;
        }