summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-11-05 16:12:49 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-11-05 16:12:49 +0100
commit43d922f1b1be8af99e947f07e1858d971ecd7aa7 (patch)
tree742837e5de591759775e290356d60514c20d2a00 /action.c
parentc4af90f626e2f1608fd129d6e749b04fe6a9ad79 (diff)
downloadrsyslog-43d922f1b1be8af99e947f07e1858d971ecd7aa7.tar.gz
rsyslog-43d922f1b1be8af99e947f07e1858d971ecd7aa7.tar.bz2
rsyslog-43d922f1b1be8af99e947f07e1858d971ecd7aa7.zip
shuffle code to be in closer proximity of related functions
Diffstat (limited to 'action.c')
-rw-r--r--action.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/action.c b/action.c
index 426430f2..46451b95 100644
--- a/action.c
+++ b/action.c
@@ -1279,6 +1279,41 @@ finalize_it:
}
+/* Call configured action, most complex case with all features supported (and thus slow).
+ * rgerhards, 2010-06-08
+ */
+#pragma GCC diagnostic ignored "-Wempty-body"
+static rsRetVal
+doSubmitToActionQComplex(action_t *pAction, wti_t *pWti, msg_t *pMsg)
+{
+ DEFiRet;
+
+ d_pthread_mutex_lock(&pAction->mutAction);
+ pthread_cleanup_push(mutexCancelCleanup, &pAction->mutAction);
+ DBGPRINTF("Called action %p (complex case), logging to %s\n",
+ pAction, module.GetStateName(pAction->pMod));
+
+ pAction->tActNow = -1; /* we do not yet know our current time (clear prev. value) */
+ // TODO: can we optimize the "now" handling again (was batch, I guess...)?
+
+ /* don't output marks to recently written outputs */
+ if(pAction->bWriteAllMarkMsgs == RSFALSE
+ && (pMsg->msgFlags & MARK) && (getActNow(pAction) - pAction->f_time) < MarkInterval / 2) {
+ ABORT_FINALIZE(RS_RET_OK);
+ }
+
+ /* call the output driver */
+ iRet = actionWriteToAction(pAction, pMsg, pWti);
+
+finalize_it:
+ d_pthread_mutex_unlock(&pAction->mutAction);
+ pthread_cleanup_pop(0); /* remove mutex cleanup handler */
+
+ RETiRet;
+}
+#pragma GCC diagnostic warning "-Wempty-body"
+
+
/* helper to activateActions, it activates a specific action.
*/
DEFFUNC_llExecFunc(doActivateActions)
@@ -1362,41 +1397,6 @@ doSubmitToActionQNotAllMark(action_t *pAction, wti_t *pWti, msg_t *pMsg)
}
-/* Call configured action, most complex case with all features supported (and thus slow).
- * rgerhards, 2010-06-08
- */
-#pragma GCC diagnostic ignored "-Wempty-body"
-static rsRetVal
-doSubmitToActionQComplex(action_t *pAction, wti_t *pWti, msg_t *pMsg)
-{
- DEFiRet;
-
- d_pthread_mutex_lock(&pAction->mutAction);
- pthread_cleanup_push(mutexCancelCleanup, &pAction->mutAction);
- DBGPRINTF("Called action %p (complex case), logging to %s\n",
- pAction, module.GetStateName(pAction->pMod));
-
- pAction->tActNow = -1; /* we do not yet know our current time (clear prev. value) */
- // TODO: can we optimize the "now" handling again (was batch, I guess...)?
-
- /* don't output marks to recently written outputs */
- if(pAction->bWriteAllMarkMsgs == RSFALSE
- && (pMsg->msgFlags & MARK) && (getActNow(pAction) - pAction->f_time) < MarkInterval / 2) {
- ABORT_FINALIZE(RS_RET_OK);
- }
-
- /* call the output driver */
- iRet = actionWriteToAction(pAction, pMsg, pWti);
-
-finalize_it:
- d_pthread_mutex_unlock(&pAction->mutAction);
- pthread_cleanup_pop(0); /* remove mutex cleanup handler */
-
- RETiRet;
-}
-#pragma GCC diagnostic warning "-Wempty-body"
-
-
/* apply all params from param block to action. This supports the v6 config system.
* Defaults must have been set appropriately during action construct!
* rgerhards, 2011-08-01