summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--action.c14
-rw-r--r--plugins/imsolaris/imsolaris.c4
-rw-r--r--plugins/imudp/imudp.c4
-rw-r--r--plugins/omudpspoof/omudpspoof.c6
-rw-r--r--runtime/modules.c8
-rw-r--r--runtime/parser.c20
-rw-r--r--runtime/srutils.c8
-rw-r--r--runtime/stream.c4
-rw-r--r--runtime/syslogd-types.h5
-rw-r--r--runtime/wti.c4
-rw-r--r--runtime/wtp.h4
-rw-r--r--tcpsrv.c2
-rw-r--r--threads.c2
-rw-r--r--tools/omfwd.c6
14 files changed, 45 insertions, 46 deletions
diff --git a/action.c b/action.c
index f131e53d..ae116ad9 100644
--- a/action.c
+++ b/action.c
@@ -20,7 +20,7 @@
* - actionWriteToAction
* - qqueueEnqObj
* (now queue engine processing)
- * if(pThis->bWriteAllMarkMsgs == FALSE) - this is the DEFAULT
+ * if(pThis->bWriteAllMarkMsgs == RSFALSE) - this is the DEFAULT
* - doSubmitToActionQNotAllMarkBatch
* - doSubmitToActionQBatch (and from here like in the else case below!)
* else
@@ -137,7 +137,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 int bActionWriteAllMarkMsgs = FALSE; /* should all mark messages be unconditionally written? */
+static int bActionWriteAllMarkMsgs = RSFALSE; /* should all mark messages be unconditionally written? */
static uchar *pszActionName; /* short name for the action */
/* action queue and its configuration parameters */
static queueType_t ActionQueType = QUEUETYPE_DIRECT; /* type of the main message queue above */
@@ -377,7 +377,7 @@ actionConstructFinalize(action_t *pThis)
pThis->iSecsExecOnceInterval
);
pThis->submitToActQ = doSubmitToActionQComplexBatch;
- } else if(pThis->bWriteAllMarkMsgs == FALSE) {
+ } else if(pThis->bWriteAllMarkMsgs == RSFALSE) {
/* nearly full-speed submission mode, default case */
pThis->submitToActQ = doSubmitToActionQNotAllMarkBatch;
} else {
@@ -1164,7 +1164,7 @@ prepareBatch(action_t *pAction, batch_t *pBatch)
if(pElem->bFilterOK && pElem->state != BATCH_STATE_DISC) {
pElem->state = BATCH_STATE_RDY;
if(prepareDoActionParams(pAction, pElem) != RS_RET_OK)
- pElem->bFilterOK = FALSE;
+ pElem->bFilterOK = RSFALSE;
}
}
RETiRet;
@@ -1456,7 +1456,7 @@ doActionCallAction(action_t *pAction, batch_t *pBatch, int idxBtch)
pAction->tActNow = -1; /* we do not yet know our current time (clear prev. value) */
/* don't output marks to recently written outputs */
- if(pAction->bWriteAllMarkMsgs == FALSE
+ if(pAction->bWriteAllMarkMsgs == RSFALSE
&& (pMsg->msgFlags & MARK) && (getActNow(pAction) - pAction->f_time) < MarkInterval / 2) {
ABORT_FINALIZE(RS_RET_OK);
}
@@ -1512,7 +1512,7 @@ finalize_it:
/* This submits the message to the action queue in case where we need to handle
- * bWriteAllMarkMessage == FALSE only. Note that we use a non-blocking CAS loop
+ * bWriteAllMarkMessage == RSFALSE only. Note that we use a non-blocking CAS loop
* for the synchronization. Here, we just modify the filter condition to be false when
* a mark message must not be written. However, in this case we must save the previous
* filter as we may need it in the next action (potential future optimization: check if this is
@@ -1769,7 +1769,7 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringReques
pAction->pszName = pszActionName;
pszActionName = NULL; /* free again! */
pAction->bWriteAllMarkMsgs = bActionWriteAllMarkMsgs;
- bActionWriteAllMarkMsgs = FALSE; /* reset */
+ bActionWriteAllMarkMsgs = RSFALSE; /* reset */
pAction->bExecWhenPrevSusp = bActExecWhenPrevSusp;
pAction->iSecsExecOnceInterval = iActExecOnceInterval;
pAction->iExecEveryNthOccur = iActExecEveryNthOccur;
diff --git a/plugins/imsolaris/imsolaris.c b/plugins/imsolaris/imsolaris.c
index ee9ec5c6..029de722 100644
--- a/plugins/imsolaris/imsolaris.c
+++ b/plugins/imsolaris/imsolaris.c
@@ -247,12 +247,12 @@ getMsgs(thrdInfo_t *pThrd, int timeout)
CHKmalloc(pRcv = (uchar*) malloc(sizeof(uchar) * (iMaxLine + 1)));
}
- while(pThrd->bShallStop != TRUE) {
+ while(pThrd->bShallStop != RSTRUE) {
DBGPRINTF("imsolaris: waiting for next message (timeout %d)...\n", timeout);
if(timeout == 0) {
nfds = poll(&sun_Pfd, 1, timeout); /* wait without timeout */
- if(pThrd->bShallStop == TRUE) {
+ if(pThrd->bShallStop == RSTRUE) {
break;
}
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 46631e97..70c21bb9 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -314,7 +314,7 @@ processSocket(thrdInfo_t *pThrd, struct lstn_s *lstn, struct sockaddr_storage *f
assert(pThrd != NULL);
iNbrTimeUsed = 0;
while(1) { /* loop is terminated if we have a bad receive, done below in the body */
- if(pThrd->bShallStop == TRUE)
+ if(pThrd->bShallStop == RSTRUE)
ABORT_FINALIZE(RS_RET_FORCE_TERM);
socklen = sizeof(struct sockaddr_storage);
lenRcvBuf = recvfrom(lstn->sock, (char*) pRcvBuf, iMaxLine, 0, (struct sockaddr *)&frominet, &socklen);
@@ -499,7 +499,7 @@ rsRetVal rcvMainLoop(thrdInfo_t *pThrd)
nfds = epoll_wait(efd, currEvt, NUM_EPOLL_EVENTS, -1);
DBGPRINTF("imudp: epoll_wait() returned with %d fds\n", nfds);
- if(pThrd->bShallStop == TRUE)
+ if(pThrd->bShallStop == RSTRUE)
break; /* terminate input! */
for(i = 0 ; i < nfds ; ++i) {
diff --git a/plugins/omudpspoof/omudpspoof.c b/plugins/omudpspoof/omudpspoof.c
index 30792531..c83cc540 100644
--- a/plugins/omudpspoof/omudpspoof.c
+++ b/plugins/omudpspoof/omudpspoof.c
@@ -208,7 +208,7 @@ UDPSend(instanceData *pData, uchar *pszSourcename, char *msg, size_t len)
inet_pton(AF_INET, (char*)pszSourcename, &(source_ip.sin_addr));
- bSendSuccess = FALSE;
+ bSendSuccess = RSFALSE;
d_pthread_mutex_lock(&mutLibnet);
bNeedUnlock = 1;
for (r = pData->f_addr; r; r = r->ai_next) {
@@ -251,12 +251,12 @@ UDPSend(instanceData *pData, uchar *pszSourcename, char *msg, size_t len)
if (lsent == -1) {
DBGPRINTF("Write error: %s\n", libnet_geterror(libnet_handle));
} else {
- bSendSuccess = TRUE;
+ bSendSuccess = RSTRUE;
break;
}
}
/* finished looping */
- if (bSendSuccess == FALSE) {
+ if (bSendSuccess == RSFALSE) {
DBGPRINTF("error forwarding via udp, suspending\n");
iRet = RS_RET_SUSPENDED;
}
diff --git a/runtime/modules.c b/runtime/modules.c
index b353e983..45788ef7 100644
--- a/runtime/modules.c
+++ b/runtime/modules.c
@@ -498,11 +498,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));
@@ -787,9 +787,9 @@ Load(uchar *pModName)
if(iModNameLen > 3 && !strcmp((char *) pModName + iModNameLen - 3, ".so")) {
iModNameLen -= 3;
- bHasExtension = TRUE;
+ bHasExtension = RSTRUE;
} else
- bHasExtension = FALSE;
+ bHasExtension = RSFALSE;
pModInfo = GetNxt(NULL);
while(pModInfo != NULL) {
diff --git a/runtime/parser.c b/runtime/parser.c
index 300db1e0..180814cf 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/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 6b88d3f4..9645a3fe 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1172,7 +1172,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);
@@ -1188,7 +1188,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 */
diff --git a/tcpsrv.c b/tcpsrv.c
index f6daadeb..238b1e8d 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -687,7 +687,7 @@ Run(tcpsrv_t *pThis)
dbgprintf("tcpsrv uses epoll() interface, nsdpol driver found\n");
/* flag that we are in epoll mode */
- pThis->bUsingEPoll = TRUE;
+ pThis->bUsingEPoll = RSTRUE;
/* Add the TCP listen sockets to the list of sockets to monitor */
for(i = 0 ; i < pThis->iLstnCurr ; ++i) {
diff --git a/threads.c b/threads.c
index 1aca6dbc..182b4789 100644
--- a/threads.c
+++ b/threads.c
@@ -96,7 +96,7 @@ thrdTerminateNonCancel(thrdInfo_t *pThis)
assert(pThis != NULL);
DBGPRINTF("request term via SIGTTIN for input thread 0x%x\n", (unsigned) pThis->thrdID);
- pThis->bShallStop = TRUE;
+ pThis->bShallStop = RSTRUE;
do {
d_pthread_mutex_lock(&pThis->mutThrd);
pthread_kill(pThis->thrdID, SIGTTIN);
diff --git a/tools/omfwd.c b/tools/omfwd.c
index b456db17..812da109 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -207,12 +207,12 @@ static rsRetVal UDPSend(instanceData *pData, char *msg, size_t len)
* call fails. Then, lsent has the error status, even though
* the sendto() succeeded. -- rgerhards, 2007-06-22
*/
- bSendSuccess = FALSE;
+ bSendSuccess = RSFALSE;
for (r = pData->f_addr; r; r = r->ai_next) {
for (i = 0; i < *pData->pSockArray; i++) {
lsent = sendto(pData->pSockArray[i+1], msg, len, 0, r->ai_addr, r->ai_addrlen);
if (lsent == len) {
- bSendSuccess = TRUE;
+ bSendSuccess = RSTRUE;
break;
} else {
int eno = errno;
@@ -225,7 +225,7 @@ static rsRetVal UDPSend(instanceData *pData, char *msg, size_t len)
break;
}
/* finished looping */
- if (bSendSuccess == FALSE) {
+ if (bSendSuccess == RSFALSE) {
dbgprintf("error forwarding via udp, suspending\n");
iRet = RS_RET_SUSPENDED;
}