diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-08-14 17:32:23 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-08-14 17:32:23 +0000 |
commit | 286e212b8e99954e34be0edf7b021d604d81bf49 (patch) | |
tree | fc771cbcf7ed280db9158485eb51869e90c32846 /sysklogd/syslogd.c | |
parent | fc385deb4270283400ffcfa9fc464c5bbf20e481 (diff) | |
download | busybox-w32-286e212b8e99954e34be0edf7b021d604d81bf49.tar.gz busybox-w32-286e212b8e99954e34be0edf7b021d604d81bf49.tar.bz2 busybox-w32-286e212b8e99954e34be0edf7b021d604d81bf49.zip |
Log all messages from a single connection, not just the first. Patch from
matthias@corelatus.com, approved by Gennady Feldman <gena01@cachier.com>.
git-svn-id: svn://busybox.net/trunk/busybox@3284 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sysklogd/syslogd.c')
-rw-r--r-- | sysklogd/syslogd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 14219eb54..25bc68f20 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -394,16 +394,17 @@ static int serveConnection (int conn) | |||
394 | { | 394 | { |
395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); | 395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); |
396 | int n_read; | 396 | int n_read; |
397 | char *p = tmpbuf; | ||
397 | 398 | ||
398 | n_read = read (conn, tmpbuf, BUFSIZE ); | 399 | n_read = read (conn, tmpbuf, BUFSIZE ); |
399 | 400 | ||
400 | if (n_read > 0) { | 401 | while (p < tmpbuf + n_read) { |
401 | 402 | ||
402 | int pri = (LOG_USER | LOG_NOTICE); | 403 | int pri = (LOG_USER | LOG_NOTICE); |
403 | char line[ BUFSIZE + 1 ]; | 404 | char line[ BUFSIZE + 1 ]; |
404 | unsigned char c; | 405 | unsigned char c; |
405 | 406 | ||
406 | char *p = tmpbuf, *q = line; | 407 | char *q = line; |
407 | 408 | ||
408 | tmpbuf[ n_read - 1 ] = '\0'; | 409 | tmpbuf[ n_read - 1 ] = '\0'; |
409 | 410 | ||
@@ -428,6 +429,7 @@ static int serveConnection (int conn) | |||
428 | p++; | 429 | p++; |
429 | } | 430 | } |
430 | *q = '\0'; | 431 | *q = '\0'; |
432 | p++; | ||
431 | /* Now log it */ | 433 | /* Now log it */ |
432 | logMessage (pri, line); | 434 | logMessage (pri, line); |
433 | } | 435 | } |