diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-17 12:46:57 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-17 12:46:57 +0200 |
commit | 60309004dfc57c3243abb2f01042950201596773 (patch) | |
tree | 707b9fbe0e4cc00133611701af0999c1bdacfbfc /plugins/imklog/linux.c | |
parent | e5130affc022eff12a3d9584576a385edbb13465 (diff) | |
download | rsyslog-60309004dfc57c3243abb2f01042950201596773.tar.gz rsyslog-60309004dfc57c3243abb2f01042950201596773.tar.bz2 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/imklog/linux.c')
-rw-r--r-- | plugins/imklog/linux.c | 8 |
1 files changed, 2 insertions, 6 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); |