summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-12 17:29:47 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-12 17:29:47 +0200
commit61f643b080234115a0d3cfc1323ff29f8a33f23e (patch)
tree97624adef9d128330add55b1fbaa2ef96a7f5ae8 /plugins
parent08fca4477cf525cada8c66d309ea1daa2eac88b2 (diff)
downloadrsyslog-61f643b080234115a0d3cfc1323ff29f8a33f23e.tar.gz
rsyslog-61f643b080234115a0d3cfc1323ff29f8a33f23e.tar.xz
rsyslog-61f643b080234115a0d3cfc1323ff29f8a33f23e.zip
enhanced immark to support non-cancel input module termination
Diffstat (limited to 'plugins')
-rw-r--r--plugins/immark/immark.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c
index 8504f872..19f43456 100644
--- a/plugins/immark/immark.c
+++ b/plugins/immark/immark.c
@@ -42,6 +42,7 @@
#include "module-template.h"
#include "errmsg.h"
#include "msg.h"
+#include "glbl.h"
MODULE_TYPE_INPUT
@@ -50,8 +51,16 @@ MODULE_TYPE_INPUT
/* Module static data */
DEF_IMOD_STATIC_DATA
+DEFobjCurrIf(glbl)
static int iMarkMessagePeriod = DEFAULT_MARK_PERIOD;
+BEGINisCompatibleWithFeature
+CODESTARTisCompatibleWithFeature
+ if(eFeat == sFEATURENonCancelInputTermination)
+ iRet = RS_RET_OK;
+ENDisCompatibleWithFeature
+
+
/* This function is called to gather input. It must terminate only
* a) on failure (iRet set accordingly)
* b) on termination of the input module (as part of the unload process)
@@ -77,6 +86,10 @@ CODESTARTrunInput
* rgerhards, 2007-12-17
*/
CHKiRet(thrdSleep(pThrd, iMarkMessagePeriod, 0)); /* seconds, micro seconds */
+
+ if(glbl.GetGlobalInputTermState() == 1)
+ break; /* terminate input! */
+
logmsgInternal(NO_ERRCODE, LOG_INFO, (uchar*)"-- MARK --", MARK);
}
finalize_it:
@@ -106,6 +119,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_IMOD_QUERIES
+CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES
ENDqueryEtryPt
static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal)
@@ -119,9 +133,9 @@ BEGINmodInit()
CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
+ CHKiRet(objUse(glbl, CORE_COMPONENT));
CHKiRet(omsdRegCFSLineHdlr((uchar *)"markmessageperiod", 0, eCmdHdlrInt, NULL, &iMarkMessagePeriod, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID));
ENDmodInit
-/*
- * vi:set ai:
+/* vi:set ai:
*/