From 4f95e5aab8d6a2d827d3fe937cf2c72229f6955e Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 11 Oct 2007 10:10:15 +0000 Subject: vi: don't wait 50 ms before reading ESC sequences inetd,syslogd: use safe_read instead of open-coded EINTR handling syslogd: bail out if you see null read from Unix socket (should never happen, but if it does, spinning forever and eating 100% CPU is not a good idea) --- sysklogd/syslogd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sysklogd') diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 284e574..ba46792 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -527,12 +527,10 @@ static void do_syslogd(void) for (;;) { size_t sz; - sz = read(sock_fd, G.recvbuf, MAX_READ - 1); + sz = safe_read(sock_fd, G.recvbuf, MAX_READ - 1); if (sz <= 0) { - if (sz == 0) - continue; /* EOF from unix socket??? */ - if (errno == EINTR) /* alarm may have happened */ - continue; + //if (sz == 0) + // continue; /* EOF from unix socket??? */ bb_perror_msg_and_die("read from /dev/log"); } -- cgit v1.1