From 6dfd44e127c153e721a398f22b510be1a5e9d0b0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 Oct 2011 20:12:08 +0200 Subject: [PATCH] fix interrupted read checks in log collection --- main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index b17f053..256a022 100644 --- a/main.c +++ b/main.c @@ -94,12 +94,14 @@ netifd_process_log_cb(struct uloop_fd *fd, unsigned int events) retry: read_len = len = read(fd->fd, buf, maxlen); - if (len <= 0) { - if (errno == EINTR) + if (len < 0) { + if (errno == EAGAIN) goto retry; goto out; - } + } else if (len == 0) + goto out; + proc->log_buf_ofs += len; cur = buf; -- 2.30.2