summaryrefslogtreecommitdiffstats
path: root/plugins/imklog/bsd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@hq.adiscon.com>2008-11-24 17:48:12 +0100
committerRainer Gerhards <rgerhards@hq.adiscon.com>2008-11-24 17:48:12 +0100
commit2275a915e02ca4fd1cd1b3c450b0089ae98bc907 (patch)
tree373c2f25ad21c75619714e93d6b84d8f74b44a30 /plugins/imklog/bsd.c
parentc2fef48bd32ac6fcd6c8664976a39424187f4872 (diff)
downloadrsyslog-2275a915e02ca4fd1cd1b3c450b0089ae98bc907.tar.gz
rsyslog-2275a915e02ca4fd1cd1b3c450b0089ae98bc907.tar.xz
rsyslog-2275a915e02ca4fd1cd1b3c450b0089ae98bc907.zip
bugfix: imklog did not compile on freeBSD
Diffstat (limited to 'plugins/imklog/bsd.c')
-rw-r--r--plugins/imklog/bsd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index 0a581081..090c4e9b 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -116,7 +116,7 @@ readklog(void)
uchar bufRcv[4096+1];
uchar *pRcv = NULL; /* receive buffer */
- iMaxLine = glbl.GetMaxLine();
+ iMaxLine = klog_getMaxLine();
/* we optimize performance: if iMaxLine is below 4K (which it is in almost all
* cases, we use a fixed buffer on the stack. Only if it is higher, heap memory
@@ -127,7 +127,8 @@ readklog(void)
if((size_t) iMaxLine < sizeof(bufRcv) - 1) {
pRcv = bufRcv;
} else {
- CHKmalloc(pRcv = (uchar*) malloc(sizeof(uchar) * (iMaxLine + 1)));
+ if((pRcv = (uchar*) malloc(sizeof(uchar) * (iMaxLine + 1))) == NULL)
+ iMaxLine = sizeof(bufRcv) - 1; /* better this than noting */
}
len = 0;
@@ -161,7 +162,6 @@ readklog(void)
if (len > 0)
Syslog(LOG_INFO, pRcv);
-finalize_it:
if(pRcv != NULL && (size_t) iMaxLine >= sizeof(bufRcv) - 1)
free(pRcv);
}