summaryrefslogtreecommitdiff
path: root/action.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
committerMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
commit84080b58f8c6c5c040723a02503ddd90f02b5898 (patch)
treecf8c63e076f1ebb9cb2bea644a4f45172808a3e5 /action.c
parent53123ea8a1b9180b9aa0568e847f9245987c1b7c (diff)
downloadrsyslog-84080b58f8c6c5c040723a02503ddd90f02b5898.tar.gz
Imported Upstream version 3.20.2upstream/3.20.2
Diffstat (limited to 'action.c')
-rw-r--r--action.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/action.c b/action.c
index 5de16b2..5f9e35d 100644
--- a/action.c
+++ b/action.c
@@ -34,7 +34,7 @@
#include <time.h>
#include <errno.h>
-#include "syslogd.h"
+#include "dirty.h"
#include "template.h"
#include "action.h"
#include "modules.h"
@@ -219,11 +219,11 @@ actionConstructFinalize(action_t *pThis)
/* ... set some properties ... */
# define setQPROP(func, directive, data) \
CHKiRet_Hdlr(func(pThis->pQueue, data)) { \
- errmsg.LogError(NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
+ errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
}
# define setQPROPstr(func, directive, data) \
CHKiRet_Hdlr(func(pThis->pQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \
- errmsg.LogError(NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
+ errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
}
queueSetpUsr(pThis->pQueue, pThis);
@@ -369,6 +369,7 @@ rsRetVal actionDbgPrint(action_t *pThis)
/* call the DoAction output plugin entry point
* rgerhards, 2008-01-28
*/
+#pragma GCC diagnostic ignored "-Wempty-body"
rsRetVal
actionCallDoAction(action_t *pAction, msg_t *pMsg)
{
@@ -453,6 +454,7 @@ finalize_it:
RETiRet;
}
+#pragma GCC diagnostic warning "-Wempty-body"
/* set the action message queue mode
* TODO: probably move this into queue object, merge with MainMsgQueue!
@@ -475,7 +477,7 @@ static rsRetVal setActionQueType(void __attribute__((unused)) *pVal, uchar *pszT
ActionQueType = QUEUETYPE_DIRECT;
dbgprintf("action queue type set to DIRECT (no queueing at all)\n");
} else {
- errmsg.LogError(NO_ERRCODE, "unknown actionqueue parameter: %s", (char *) pszType);
+ errmsg.LogError(0, RS_RET_INVALID_PARAMS, "unknown actionqueue parameter: %s", (char *) pszType);
iRet = RS_RET_INVALID_PARAMS;
}
d_free(pszType); /* no longer needed */
@@ -541,7 +543,7 @@ actionWriteToAction(action_t *pAction)
pAction->f_pMsg = pMsg; /* use the new msg (pointer will be restored below) */
}
- dbgprintf("Called action, logging to %s", module.GetStateName(pAction->pMod));
+ dbgprintf("Called action, logging to %s\n", module.GetStateName(pAction->pMod));
time(&now); /* we need this for message repeation processing AND $ActionExecOnlyOnceEveryInterval */
if(pAction->tLastExec > now) {
@@ -592,6 +594,7 @@ finalize_it:
/* call the configured action. Does all necessary housekeeping.
* rgerhards, 2007-08-01
*/
+#pragma GCC diagnostic ignored "-Wempty-body"
rsRetVal
actionCallAction(action_t *pAction, msg_t *pMsg)
{
@@ -676,6 +679,7 @@ finalize_it:
pthread_setcancelstate(iCancelStateSave, NULL);
RETiRet;
}
+#pragma GCC diagnostic warning "-Wempty-body"
/* add our cfsysline handlers
@@ -763,14 +767,14 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringReques
" Could not find template '%s' - action disabled\n",
pTplName);
errno = 0;
- errmsg.LogError(NO_ERRCODE, "%s", errMsg);
+ errmsg.LogError(0, RS_RET_NOT_FOUND, "%s", errMsg);
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}
/* check required template options */
if( (iTplOpts & OMSR_RQD_TPL_OPT_SQL)
&& (pAction->ppTpl[i]->optFormatForSQL == 0)) {
errno = 0;
- errmsg.LogError(NO_ERRCODE, "Action disabled. To use this action, you have to specify "
+ errmsg.LogError(0, RS_RET_RQD_TPLOPT_MISSING, "Action disabled. To use this action, you have to specify "
"the SQL or stdSQL option in your template!\n");
ABORT_FINALIZE(RS_RET_RQD_TPLOPT_MISSING);
}