in log read, check for EINTR instead of EAGAIN to avoid infinite loops
authorFelix Fietkau <nbd@openwrt.org>
Thu, 20 Oct 2011 23:04:05 +0000 (01:04 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 20 Oct 2011 23:04:05 +0000 (01:04 +0200)
main.c

diff --git a/main.c b/main.c
index bed0edd4167c2e25a2e5465cb798bb3c741d81d4..2fc3733faaf9a4e5205efee68915b282a221ffa5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -90,7 +90,7 @@ retry:
        maxlen = LOG_BUF_SIZE - proc->log_buf_ofs;
        read_len = len = read(fd->fd, buf, maxlen);
        if (len < 0) {
-               if (errno == EAGAIN)
+               if (errno == EINTR)
                        goto retry;
 
                goto out;