diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-11 10:10:15 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-11 10:10:15 +0000 |
commit | 4f95e5aab8d6a2d827d3fe937cf2c72229f6955e (patch) | |
tree | 3985763ee17b6bb2a75c0143f61dc21f1384cf02 /sysklogd/syslogd.c | |
parent | f9566d8c29a820e94f194a9ac303c912899e6c8a (diff) | |
download | busybox-w32-4f95e5aab8d6a2d827d3fe937cf2c72229f6955e.tar.gz busybox-w32-4f95e5aab8d6a2d827d3fe937cf2c72229f6955e.tar.bz2 busybox-w32-4f95e5aab8d6a2d827d3fe937cf2c72229f6955e.zip |
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)
Diffstat (limited to 'sysklogd/syslogd.c')
-rw-r--r-- | sysklogd/syslogd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 284e5743c..ba46792b6 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -527,12 +527,10 @@ static void do_syslogd(void) | |||
527 | for (;;) { | 527 | for (;;) { |
528 | size_t sz; | 528 | size_t sz; |
529 | 529 | ||
530 | sz = read(sock_fd, G.recvbuf, MAX_READ - 1); | 530 | sz = safe_read(sock_fd, G.recvbuf, MAX_READ - 1); |
531 | if (sz <= 0) { | 531 | if (sz <= 0) { |
532 | if (sz == 0) | 532 | //if (sz == 0) |
533 | continue; /* EOF from unix socket??? */ | 533 | // continue; /* EOF from unix socket??? */ |
534 | if (errno == EINTR) /* alarm may have happened */ | ||
535 | continue; | ||
536 | bb_perror_msg_and_die("read from /dev/log"); | 534 | bb_perror_msg_and_die("read from /dev/log"); |
537 | } | 535 | } |
538 | 536 | ||