From: Timo Kokkonen Date: Sun, 6 Oct 2013 19:58:07 +0000 (+0300) Subject: Fix read return value check X-Git-Url: http://git.itanic.dy.fi/?p=log-plotter;a=commitdiff_plain;h=405e6dcf1dcbfbdcf68ebf21892d4f5a8498dff9 Fix read return value check We wish to check against the return value of read, not the function pointer.. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index e116477..6cfdd87 100644 --- 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; }