summaryrefslogtreecommitdiffstats
path: root/plugins/imklog/bsd.c
diff options
context:
space:
mode:
authorMichael Terry <mike@bongo.(none)>2009-06-18 13:51:17 -0400
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-29 10:58:38 +0200
commitba4806a70439dd24dc98bd707893b1319dd5e3ef (patch)
tree0d899a388b125f2dd6f5442809e40830c56ed8b9 /plugins/imklog/bsd.c
parent279896ebda98804c89899c53f857ca189ab24f45 (diff)
downloadrsyslog-ba4806a70439dd24dc98bd707893b1319dd5e3ef.tar.gz
rsyslog-ba4806a70439dd24dc98bd707893b1319dd5e3ef.tar.xz
rsyslog-ba4806a70439dd24dc98bd707893b1319dd5e3ef.zip
add support for KLogPath
Diffstat (limited to 'plugins/imklog/bsd.c')
-rw-r--r--plugins/imklog/bsd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index 090c4e9b..6d7b6c98 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -83,6 +83,11 @@ static int fklog = -1; /* /dev/klog */
# define _PATH_KLOG "/dev/klog"
#endif
+static uchar *GetPath(void)
+{
+ return pszPath ? pszPath : _PATH_KLOG;
+}
+
/* open the kernel log - will be called inside the willRun() imklog
* entry point. -- rgerhards, 2008-04-09
*/
@@ -91,9 +96,9 @@ klogWillRun(void)
{
DEFiRet;
- fklog = open(_PATH_KLOG, O_RDONLY, 0);
+ fklog = open(GetPath(), O_RDONLY, 0);
if (fklog < 0) {
- dbgprintf("can't open %s (%d)\n", _PATH_KLOG, errno);
+ dbgprintf("can't open %s (%d)\n", GetPath(), errno);
iRet = RS_RET_ERR; // TODO: better error code
}