diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-19 14:49:57 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-19 14:49:57 +0200 |
commit | 67aebe1d0f21de2426110eae69d36e8be1e792ef (patch) | |
tree | c921e5a52fe89ad329339a8e63954ad34aab485b /tools/omfile.c | |
parent | 708b695283687eb2571e6cc48c9ccb0bc30f9711 (diff) | |
download | rsyslog-67aebe1d0f21de2426110eae69d36e8be1e792ef.tar.gz rsyslog-67aebe1d0f21de2426110eae69d36e8be1e792ef.tar.bz2 rsyslog-67aebe1d0f21de2426110eae69d36e8be1e792ef.zip |
bugfix: omfile action did not respect "template" parameter
... and used default template in all cases
Diffstat (limited to 'tools/omfile.c')
-rw-r--r-- | tools/omfile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/omfile.c b/tools/omfile.c index 1a36343f..1ccd4a56 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -885,6 +885,7 @@ setInstParamDefaults(instanceData *pData) BEGINnewActInst struct cnfparamvals *pvals; + uchar *tplToUse; int i; CODESTARTnewActInst DBGPRINTF("newActInst (omfile)\n"); @@ -959,7 +960,8 @@ CODESTARTnewActInst ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); } - CHKiRet(OMSRsetEntry(*ppOMSR, 0, ustrdup(getDfltTpl()), OMSR_NO_RQD_TPL_OPTS)); + tplToUse = (pData->tplName == NULL) ? ustrdup(getDfltTpl()) : pData->tplName; + CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_NO_RQD_TPL_OPTS)); if(pData->bDynamicName) { /* "filename" is actually a template name, we need this as string 1. So let's add it |