summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2001-08-14 17:32:23 +0000
committerMatt Kraai2001-08-14 17:32:23 +0000
commitb6ec78161ddb081315ef468bd245fcd9f6c5f8df (patch)
treefc771cbcf7ed280db9158485eb51869e90c32846
parent0a6859031493951de02cc00e18f0da2bd305fc05 (diff)
downloadbusybox-b6ec78161ddb081315ef468bd245fcd9f6c5f8df.zip
busybox-b6ec78161ddb081315ef468bd245fcd9f6c5f8df.tar.gz
Log all messages from a single connection, not just the first. Patch from
matthias@corelatus.com, approved by Gennady Feldman <gena01@cachier.com>.
-rw-r--r--sysklogd/syslogd.c6
-rw-r--r--syslogd.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 14219eb..25bc68f 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -394,16 +394,17 @@ static int serveConnection (int conn)
{
RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
int n_read;
+ char *p = tmpbuf;
n_read = read (conn, tmpbuf, BUFSIZE );
- if (n_read > 0) {
+ while (p < tmpbuf + n_read) {
int pri = (LOG_USER | LOG_NOTICE);
char line[ BUFSIZE + 1 ];
unsigned char c;
- char *p = tmpbuf, *q = line;
+ char *q = line;
tmpbuf[ n_read - 1 ] = '\0';
@@ -428,6 +429,7 @@ static int serveConnection (int conn)
p++;
}
*q = '\0';
+ p++;
/* Now log it */
logMessage (pri, line);
}
diff --git a/syslogd.c b/syslogd.c
index 14219eb..25bc68f 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -394,16 +394,17 @@ static int serveConnection (int conn)
{
RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
int n_read;
+ char *p = tmpbuf;
n_read = read (conn, tmpbuf, BUFSIZE );
- if (n_read > 0) {
+ while (p < tmpbuf + n_read) {
int pri = (LOG_USER | LOG_NOTICE);
char line[ BUFSIZE + 1 ];
unsigned char c;
- char *p = tmpbuf, *q = line;
+ char *q = line;
tmpbuf[ n_read - 1 ] = '\0';
@@ -428,6 +429,7 @@ static int serveConnection (int conn)
p++;
}
*q = '\0';
+ p++;
/* Now log it */
logMessage (pri, line);
}