summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-12 09:18:04 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-12 09:18:04 +0200
commit21b7f7e603639fa8f354c954b0e467abb72b6c12 (patch)
treed248c1ac41b07a37f8423a01efe613d66c5ef23f /action.c
parent1e4f374d7d087fac8fbe807545ea1ed3f44c80e1 (diff)
parentd1985c4a65feb5caaea855517431ed564a13ed4c (diff)
downloadrsyslog-21b7f7e603639fa8f354c954b0e467abb72b6c12.tar.gz
rsyslog-21b7f7e603639fa8f354c954b0e467abb72b6c12.tar.xz
rsyslog-21b7f7e603639fa8f354c954b0e467abb72b6c12.zip
Merge branch 'master' into multi-dequeue
Conflicts: runtime/rsyslog.h
Diffstat (limited to 'action.c')
-rw-r--r--action.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/action.c b/action.c
index 829ef1eb..509ad749 100644
--- a/action.c
+++ b/action.c
@@ -63,6 +63,7 @@ static int glbliActionResumeInterval = 30;
int glbliActionResumeRetryCount = 0; /* how often should suspended actions be retried? */
static int bActionRepMsgHasMsg = 0; /* last messsage repeated... has msg fragment in it */
+static uchar *pszActionName; /* short name for the action */
/* main message queue and its configuration parameters */
static queueType_t ActionQueType = QUEUETYPE_DIRECT; /* type of the main message queue above */
static int iActionQueueSize = 1000; /* size of the main message queue above */
@@ -168,8 +169,7 @@ actionResetQueueParams(void)
glbliActionResumeRetryCount = 0; /* I guess it is smart to reset this one, too */
- if(pszActionQFName != NULL)
- d_free(pszActionQFName);
+ d_free(pszActionQFName);
pszActionQFName = NULL; /* prefix for the main message queue file */
RETiRet;
@@ -196,8 +196,8 @@ rsRetVal actionDestruct(action_t *pThis)
SYNC_OBJ_TOOL_EXIT(pThis);
pthread_mutex_destroy(&pThis->mutActExec);
- if(pThis->ppTpl != NULL)
- d_free(pThis->ppTpl);
+ d_free(pThis->pszName);
+ d_free(pThis->ppTpl);
d_free(pThis);
RETiRet;
@@ -1139,6 +1139,7 @@ actionAddCfSysLineHdrl(void)
{
DEFiRet;
+ CHKiRet(regCfSysLineHdlr((uchar *)"actionname", 0, eCmdHdlrGetWord, NULL, &pszActionName, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuefilename", 0, eCmdHdlrGetWord, NULL, &pszActionQFName, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesize", 0, eCmdHdlrInt, NULL, &iActionQueueSize, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuebatchsize", 0, eCmdHdlrInt, NULL, &iActionQueueDeqBatchSize, NULL));
@@ -1192,6 +1193,8 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringReques
CHKiRet(actionConstruct(&pAction)); /* create action object first */
pAction->pMod = pMod;
pAction->pModData = pModData;
+ pAction->pszName = pszActionName;
+ pszActionName = NULL; /* free again! */
pAction->bExecWhenPrevSusp = bActExecWhenPrevSusp;
pAction->iSecsExecOnceInterval = iActExecOnceInterval;
pAction->iExecEveryNthOccur = iActExecEveryNthOccur;