summaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorErik Andersen2000-04-18 00:00:52 +0000
committerErik Andersen2000-04-18 00:00:52 +0000
commita6c752201e9031b51a6d89349f1cec1f690f56ef (patch)
tree808a54e0dc112d8b32326ccdb411e4300dc65d76 /sysklogd
parent91e581fa0438b39ceb0ffb4ddcb90ee4d260ae81 (diff)
downloadbusybox-a6c752201e9031b51a6d89349f1cec1f690f56ef.zip
busybox-a6c752201e9031b51a6d89349f1cec1f690f56ef.tar.gz
Updates
-Erik
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/syslogd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 8827265..228d0a1 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -226,18 +226,20 @@ static void doSyslogd (void)
}
else {
#define BUFSIZE 1024 + 1
- char buf[BUFSIZE];
+ char buf;
char *q, *p;
int n_read;
char line[BUFSIZE];
unsigned char c;
+ int pri;
- /* Keep reading stuff till there is nothing else to read */
- while( (n_read = read (fd, buf, BUFSIZE)) > 0 && errno != EOF) {
- int pri = (LOG_USER | LOG_NOTICE);
+ /* Get set to read in a line */
+ memset (line, 0, sizeof(line));
+ pri = (LOG_USER | LOG_NOTICE);
- memset (line, 0, sizeof(line));
- p = buf;
+ /* Keep reading stuff till there is nothing else to read */
+ while( (n_read = read (fd, &buf, 1)) > 0) {
+ p = &buf;
q = line;
while (p && (c = *p) && q < &line[sizeof(line) - 1]) {
if (c == '<') {
@@ -262,6 +264,7 @@ static void doSyslogd (void)
/* Now log it */
logMessage(pri, line);
+ break;
}
close (fd);
FD_CLR (fd, &readfds);