summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-17 12:46:57 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-17 12:46:57 +0200
commit60309004dfc57c3243abb2f01042950201596773 (patch)
tree707b9fbe0e4cc00133611701af0999c1bdacfbfc /plugins
parente5130affc022eff12a3d9584576a385edbb13465 (diff)
downloadrsyslog-60309004dfc57c3243abb2f01042950201596773.tar.gz
rsyslog-60309004dfc57c3243abb2f01042950201596773.tar.xz
rsyslog-60309004dfc57c3243abb2f01042950201596773.zip
completed better modularity of runtime
- added the ability to specify an error log function for the runtime - removed dependency of core runtime on dirty.h Note that it is "better" modularity, not perfect. There is still work to do, but I think we can for the time being proceed with other things.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imklog/linux.c8
-rw-r--r--plugins/immark/immark.c2
-rw-r--r--plugins/imuxsock/imuxsock.c5
3 files changed, 4 insertions, 11 deletions
diff --git a/plugins/imklog/linux.c b/plugins/imklog/linux.c
index d00723dd..32cf70c4 100644
--- a/plugins/imklog/linux.c
+++ b/plugins/imklog/linux.c
@@ -146,9 +146,7 @@ static enum LOGSRC GetKernelLogSrc(void)
if ( (kmsg = open(_PATH_KLOG, O_RDONLY)) < 0 )
{
- char sz[512];
- snprintf(sz, sizeof(sz), "imklog: Cannot open proc file system, %d - %s.\n", errno, strerror(errno));
- logmsgInternal(LOG_SYSLOG|LOG_ERR, sz, ADDDATE);
+ imklogLogIntMsg(LOG_ERR, "imklog: Cannot open proc file system, %d.\n", errno);
ksyslog(7, NULL, 0); /* TODO: check this, implement more */
return(none);
}
@@ -427,11 +425,9 @@ static void LogKernelLine(void)
memset(log_buffer, '\0', sizeof(log_buffer));
if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer)-1)) < 0 )
{
- char sz[512];
if(errno == EINTR)
return;
- snprintf(sz, sizeof(sz), "imklog: Error return from sys_sycall: %d - %s\n", errno, strerror(errno));
- logmsgInternal(LOG_SYSLOG|LOG_ERR, sz, ADDDATE);
+ imklogLogIntMsg(LOG_ERR, "imklog Error return from sys_sycall: %d\n", errno);
}
else
LogLine(log_buffer, rdcnt);
diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c
index 1907bb25..ebdcabe9 100644
--- a/plugins/immark/immark.c
+++ b/plugins/immark/immark.c
@@ -75,7 +75,7 @@ CODESTARTrunInput
* rgerhards, 2007-12-17
*/
CHKiRet(thrdSleep(pThrd, iMarkMessagePeriod, 0)); /* seconds, micro seconds */
- logmsgInternal(LOG_INFO, "-- MARK --", ADDDATE|MARK);
+ logmsgInternal(LOG_INFO, (uchar*)"-- MARK --", ADDDATE|MARK);
}
finalize_it:
return iRet;
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index 6c6b7f94..94f97eb5 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -103,8 +103,6 @@ static rsRetVal setSystemLogTimestampIgnore(void __attribute__((unused)) *pVal,
*/
static rsRetVal addLstnSocketName(void __attribute__((unused)) *pVal, uchar *pNewVal)
{
- char errStr[1024];
-
if(nfunix < MAXFUNIX) {
if(*pNewVal == ':') {
funixParseHost[nfunix] = 1;
@@ -116,9 +114,8 @@ static rsRetVal addLstnSocketName(void __attribute__((unused)) *pVal, uchar *pNe
funixn[nfunix++] = pNewVal;
}
else {
- snprintf(errStr, sizeof(errStr), "rsyslogd: Out of unix socket name descriptors, ignoring %s\n",
+ errmsg.LogError(NO_ERRCODE, "Out of unix socket name descriptors, ignoring %s\n",
pNewVal);
- logmsgInternal(LOG_SYSLOG|LOG_ERR, errStr, ADDDATE);
}
return RS_RET_OK;