summaryrefslogtreecommitdiffstats
path: root/plugins/imkmsg/kmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/imkmsg/kmsg.c')
-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) {