From 405e6dcf1dcbfbdcf68ebf21892d4f5a8498dff9 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sun, 6 Oct 2013 22:58:07 +0300 Subject: [PATCH] Fix read return value check We wish to check against the return value of read, not the function pointer.. Signed-off-by: Timo Kokkonen --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.44.0