summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-03-18 12:31:20 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-03-18 12:31:20 +0100
commitdac7e3d39b7d2dfe5c3fddf38275b2ca49d5396e (patch)
treecb10a26f7025e989cd3a01bb9df829763d5c6c4d /plugins
parent4dce63486fbb197522e11c5644cdf7aef5d7bbbc (diff)
parentff261830c65f7d094584dba1f9bce669bd6748d4 (diff)
downloadrsyslog-dac7e3d39b7d2dfe5c3fddf38275b2ca49d5396e.tar.gz
rsyslog-dac7e3d39b7d2dfe5c3fddf38275b2ca49d5396e.tar.bz2
rsyslog-dac7e3d39b7d2dfe5c3fddf38275b2ca49d5396e.zip
Merge branch 'v7-stable'
Conflicts: runtime/debug.h tools/syslogd.c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imkmsg/kmsg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c
index c531f941..f1815f25 100644
--- a/plugins/imkmsg/kmsg.c
+++ b/plugins/imkmsg/kmsg.c
@@ -107,7 +107,7 @@ submitSyslog(uchar *buf)
if (*buf != '\0') /* message has appended properties, skip \n */
buf++;
- while (strlen((char *)buf)) {
+ while (*buf) {
/* get name of the property */
buf++; /* skip ' ' */
offs = 0;
@@ -178,18 +178,22 @@ static void
readkmsg(void)
{
int i;
- uchar pRcv[8096+1];
+ uchar pRcv[8192+1];
char errmsg[2048];
for (;;) {
dbgprintf("imkmsg waiting for kernel log line\n");
/* every read() from the opened device node receives one record of the printk buffer */
- i = read(fklog, pRcv, 8096);
+ i = read(fklog, pRcv, 8192);
if (i > 0) {
/* successful read of message of nonzero length */
pRcv[i] = '\0';
+ } else if (i == -EPIPE) {
+ imkmsgLogIntMsg(LOG_WARNING,
+ "imkmsg: some messages in circular buffer got overwritten");
+ continue;
} else {
/* something went wrong - error or zero length message */
if (i < 0 && errno != EINTR && errno != EAGAIN) {