summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-25 11:55:41 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-25 11:55:41 +0200
commit8939ccfffd3a0580ead376234ad64a9602d4e4e6 (patch)
tree1749d023b626b2d30d9b9273b0d4f11fcbffea1b /runtime
parent0f52727043736b1e411bc60309ed18d41a4f1234 (diff)
parent0c65e62965eefc1f8cebfaa3636ef72fc21c5260 (diff)
downloadrsyslog-8939ccfffd3a0580ead376234ad64a9602d4e4e6.tar.gz
rsyslog-8939ccfffd3a0580ead376234ad64a9602d4e4e6.tar.xz
rsyslog-8939ccfffd3a0580ead376234ad64a9602d4e4e6.zip
Merge branch 'v5-stable' into v6-stable
Conflicts: ChangeLog action.c configure.ac doc/manual.html runtime/ruleset.c template.h threads.c tools/syslogd.c
Diffstat (limited to 'runtime')
-rw-r--r--runtime/modules.c8
-rw-r--r--runtime/msg.c2
-rw-r--r--runtime/parser.c20
-rw-r--r--runtime/ruleset.c9
-rw-r--r--runtime/srutils.c8
-rw-r--r--runtime/stream.c8
-rw-r--r--runtime/syslogd-types.h5
-rw-r--r--runtime/wti.c4
-rw-r--r--runtime/wtp.h4
9 files changed, 34 insertions, 34 deletions
diff --git a/runtime/modules.c b/runtime/modules.c
index dac3bd95..39f977dd 100644
--- a/runtime/modules.c
+++ b/runtime/modules.c
@@ -634,11 +634,11 @@ doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)(), modInfo_
/* check some features */
localRet = pNew->isCompatibleWithFeature(sFEATUREAutomaticSanitazion);
if(localRet == RS_RET_OK){
- CHKiRet(parser.SetDoSanitazion(pParser, TRUE));
+ CHKiRet(parser.SetDoSanitazion(pParser, RSTRUE));
}
localRet = pNew->isCompatibleWithFeature(sFEATUREAutomaticPRIParsing);
if(localRet == RS_RET_OK){
- CHKiRet(parser.SetDoPRIParsing(pParser, TRUE));
+ CHKiRet(parser.SetDoPRIParsing(pParser, RSTRUE));
}
CHKiRet(parser.SetName(pParser, pName));
@@ -966,9 +966,9 @@ Load(uchar *pModName, sbool bConfLoad)
if(iModNameLen > 3 && !strcmp((char *) pModName + iModNameLen - 3, ".so")) {
iModNameLen -= 3;
- bHasExtension = TRUE;
+ bHasExtension = RSTRUE;
} else
- bHasExtension = FALSE;
+ bHasExtension = RSFALSE;
CHKiRet(findModule(pModName, iModNameLen, &pModInfo));
if(pModInfo != NULL) {
diff --git a/runtime/msg.c b/runtime/msg.c
index 99874317..da751dba 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2814,11 +2814,13 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
++pFld; /* skip to field terminator */
if(*pFld == pTpe->data.field.field_delim) {
++pFld; /* eat it */
+#ifdef STRICT_GPLV3
if (pTpe->data.field.field_expand != 0) {
while (*pFld == pTpe->data.field.field_delim) {
++pFld;
}
}
+#endif
++iCurrFld;
}
}
diff --git a/runtime/parser.c b/runtime/parser.c
index a79f2ce8..fd940e9d 100644
--- a/runtime/parser.c
+++ b/runtime/parser.c
@@ -311,7 +311,7 @@ SanitizeMsg(msg_t *pMsg)
size_t iDst;
size_t iMaxLine;
size_t maxDest;
- sbool bUpdatedLen = FALSE;
+ sbool bUpdatedLen = RSFALSE;
uchar szSanBuf[32*1024]; /* buffer used for sanitizing a string */
assert(pMsg != NULL);
@@ -326,7 +326,7 @@ SanitizeMsg(msg_t *pMsg)
*/
if(pszMsg[lenMsg-1] == '\0') {
DBGPRINTF("dropped NUL at very end of message\n");
- bUpdatedLen = TRUE;
+ bUpdatedLen = RSTRUE;
lenMsg--;
}
@@ -339,7 +339,7 @@ SanitizeMsg(msg_t *pMsg)
DBGPRINTF("dropped LF at very end of message (DropTrailingLF is set)\n");
lenMsg--;
pszMsg[lenMsg] = '\0';
- bUpdatedLen = TRUE;
+ bUpdatedLen = RSTRUE;
}
/* it is much quicker to sweep over the message and see if it actually
@@ -370,7 +370,7 @@ SanitizeMsg(msg_t *pMsg)
}
if(!bNeedSanitize) {
- if(bUpdatedLen == TRUE)
+ if(bUpdatedLen == RSTRUE)
MsgSetRawMsgSize(pMsg, lenMsg);
FINALIZE;
}
@@ -508,17 +508,17 @@ ParseMsg(msg_t *pMsg)
DBGPRINTF("parse using parser list %p%s.\n", pParserList,
(pParserList == pDfltParsLst) ? " (the default list)" : "");
- bIsSanitized = FALSE;
- bPRIisParsed = FALSE;
+ bIsSanitized = RSFALSE;
+ bPRIisParsed = RSFALSE;
while(pParserList != NULL) {
pParser = pParserList->pParser;
- if(pParser->bDoSanitazion && bIsSanitized == FALSE) {
+ if(pParser->bDoSanitazion && bIsSanitized == RSFALSE) {
CHKiRet(SanitizeMsg(pMsg));
- if(pParser->bDoPRIParsing && bPRIisParsed == FALSE) {
+ if(pParser->bDoPRIParsing && bPRIisParsed == RSFALSE) {
CHKiRet(ParsePRI(pMsg));
- bPRIisParsed = TRUE;
+ bPRIisParsed = RSTRUE;
}
- bIsSanitized = TRUE;
+ bIsSanitized = RSTRUE;
}
localRet = pParser->pModule->mod.pm.parse(pMsg);
dbgprintf("Parser '%s' returned %d\n", pParser->pName, localRet);
diff --git a/runtime/ruleset.c b/runtime/ruleset.c
index c384663a..a6eca307 100644
--- a/runtime/ruleset.c
+++ b/runtime/ruleset.c
@@ -497,7 +497,7 @@ debugPrintAll(rsconf_t *conf)
static inline rsRetVal
doRulesetCreateQueue(rsconf_t *conf, int *pNewVal)
{
- uchar *rulesetMainQName;
+ uchar *rsname;
DEFiRet;
if(conf->rulesets.pCurr == NULL) {
@@ -515,10 +515,9 @@ doRulesetCreateQueue(rsconf_t *conf, int *pNewVal)
if(pNewVal == 0)
FINALIZE; /* if it is turned off, we do not need to change anything ;) */
- dbgprintf("adding a ruleset-specific \"main\" queue");
- rulesetMainQName = (conf->rulesets.pCurr->pszName == NULL)? UCHAR_CONSTANT("ruleset") :
- conf->rulesets.pCurr->pszName;
- CHKiRet(createMainQueue(&conf->rulesets.pCurr->pQueue, rulesetMainQName));
+ rsname = (conf->rulesets.pCurr->pszName == NULL) ? (uchar*) "[ruleset]" : conf->rulesets.pCurr->pszName;
+ DBGPRINTF("adding a ruleset-specific \"main\" queue for ruleset '%s'\n", rsname);
+ CHKiRet(createMainQueue(&conf->rulesets.pCurr->pQueue, rsname));
finalize_it:
RETiRet;
diff --git a/runtime/srutils.c b/runtime/srutils.c
index a473c83e..f420c0f7 100644
--- a/runtime/srutils.c
+++ b/runtime/srutils.c
@@ -41,8 +41,6 @@
#include <assert.h>
#include <sys/wait.h>
#include <ctype.h>
-#define TRUE 1
-#define FALSE 0
#include "srUtils.h"
#include "obj.h"
@@ -128,11 +126,11 @@ rsRetVal srUtilItoA(char *pBuf, int iLenBuf, number_t iToConv)
if(iToConv < 0)
{
- bIsNegative = TRUE;
+ bIsNegative = RSTRUE;
iToConv *= -1;
}
else
- bIsNegative = FALSE;
+ bIsNegative = RSFALSE;
/* first generate a string with the digits in the reverse direction */
i = 0;
@@ -148,7 +146,7 @@ rsRetVal srUtilItoA(char *pBuf, int iLenBuf, number_t iToConv)
return RS_RET_PROVIDED_BUFFER_TOO_SMALL;
/* then move it to the right direction... */
- if(bIsNegative == TRUE)
+ if(bIsNegative == RSTRUE)
*pBuf++ = '-';
while(i >= 0)
*pBuf++ = szBuf[i--];
diff --git a/runtime/stream.c b/runtime/stream.c
index bb1a0a42..742799d2 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1010,6 +1010,7 @@ asyncWriterThread(void *pPtr)
struct timespec t;
sbool bTimedOut = 0;
strm_t *pThis = (strm_t*) pPtr;
+ int err;
ISOBJ_TYPE_assert(pThis, strm);
BEGINfunc
@@ -1036,8 +1037,7 @@ asyncWriterThread(void *pPtr)
bTimedOut = 0;
timeoutComp(&t, pThis->iFlushInterval * 1000); /* *1000 millisconds */
if(pThis->bDoTimedWait) {
- if(pthread_cond_timedwait(&pThis->notEmpty, &pThis->mut, &t) != 0) {
- int err = errno;
+ if((err = pthread_cond_timedwait(&pThis->notEmpty, &pThis->mut, &t)) != 0) {
if(err == ETIMEDOUT) {
bTimedOut = 1;
} else {
@@ -1170,7 +1170,7 @@ doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf)
{
z_stream zstrm;
int zRet; /* zlib return state */
- sbool bzInitDone = FALSE;
+ sbool bzInitDone = RSFALSE;
DEFiRet;
assert(pThis != NULL);
assert(pBuf != NULL);
@@ -1186,7 +1186,7 @@ doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf)
DBGPRINTF("error %d returned from zlib/deflateInit2()\n", zRet);
ABORT_FINALIZE(RS_RET_ZLIB_ERR);
}
- bzInitDone = TRUE;
+ bzInitDone = RSTRUE;
/* now doing the compression */
zstrm.next_in = (Bytef*) pBuf; /* as of zlib doc, this must be set BEFORE DeflateInit2 */
diff --git a/runtime/syslogd-types.h b/runtime/syslogd-types.h
index 30ce896a..6947a110 100644
--- a/runtime/syslogd-types.h
+++ b/runtime/syslogd-types.h
@@ -31,8 +31,9 @@
#include <syslog.h>
#endif
-#define FALSE 0
-#define TRUE 1
+/* we use RSTRUE/FALSE to prevent name claches with other packages */
+#define RSFALSE 0
+#define RSTRUE 1
#ifdef UT_NAMESIZE
# define UNAMESZ UT_NAMESIZE /* length of a login name */
diff --git a/runtime/wti.c b/runtime/wti.c
index e44086af..7b88c3eb 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -86,7 +86,7 @@ rsRetVal
wtiSetAlwaysRunning(wti_t *pThis)
{
ISOBJ_TYPE_assert(pThis, wti);
- pThis->bAlwaysRunning = TRUE;
+ pThis->bAlwaysRunning = RSTRUE;
return RS_RET_OK;
}
@@ -198,7 +198,7 @@ wtiConstructFinalize(wti_t *pThis)
dbgprintf("%s: finalizing construction of worker instance data\n", wtiGetDbgHdr(pThis));
/* initialize our thread instance descriptor (no concurrency here) */
- pThis->bIsRunning = FALSE;
+ pThis->bIsRunning = RSFALSE;
/* we now alloc the array for user pointers. We obtain the max from the queue itself. */
CHKiRet(pThis->pWtp->pfGetDeqBatchSize(pThis->pWtp->pUsr, &iDeqBatchSize));
diff --git a/runtime/wtp.h b/runtime/wtp.h
index 7e24ec82..25992f7f 100644
--- a/runtime/wtp.h
+++ b/runtime/wtp.h
@@ -27,8 +27,8 @@
#include "atomic.h"
/* states for worker threads. */
-#define WRKTHRD_STOPPED FALSE
-#define WRKTHRD_RUNNING TRUE
+#define WRKTHRD_STOPPED RSFALSE
+#define WRKTHRD_RUNNING RSTRUE
/* possible states of a worker thread pool */