summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog28
-rw-r--r--action.c25
-rw-r--r--action.h1
-rw-r--r--configure.ac5
-rw-r--r--plugins/imfile/imfile.c6
-rw-r--r--runtime/datetime.h1
-rw-r--r--runtime/errmsg.h1
-rw-r--r--runtime/expr.h1
-rw-r--r--runtime/glbl.c37
-rw-r--r--runtime/modules.h1
-rw-r--r--runtime/queue.c17
-rw-r--r--runtime/queue.h1
-rw-r--r--runtime/rsyslog.h1
-rw-r--r--threads.c8
-rw-r--r--tools/iminternal.c6
-rw-r--r--tools/iminternal.h5
-rw-r--r--tools/syslogd.c5
17 files changed, 108 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d86a077..d9ed9f6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
---------------------------------------------------------------------------
Version 6.1.4 [DEVEL] (rgerhards), 2011-02-??
+- imported fixes and and enhancements from 5.7.4
- bugfix/omhdfs: directive $OMHDFSFileName rendered unusable
due to a search and replace-induced bug ;)
+- bugfix: minor race condition in action.c - considered cosmetic
+ This is considered cosmetic as multiple threads tried to write exactly
+ the same value into the same memory location without sync. The method
+ has been changed so this can no longer happen.
---------------------------------------------------------------------------
Version 6.1.3 [DEVEL] (rgerhards), 2011-02-01
- experimental support for monogodb added
@@ -76,14 +81,33 @@ expected that interfaces, even new ones, break during the initial
syslog plain tcp input plugin (NOT supporting TLS!)
[ported from v4]
---------------------------------------------------------------------------
-Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-??
+Version 5.7.5 [V5-BETA] (rgerhards), 2011-02-??
+- bugfix: minor race condition in action.c - considered cosmetic
+ This is considered cosmetic as multiple threads tried to write exactly
+ the same value into the same memory location without sync. The method
+ has been changed so this can no longer happen.
+---------------------------------------------------------------------------
+Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-17
- added pmsnare parser module (written by David Lang)
- enhanced imfile to support non-cancel input termination
- improved systemd socket activation thanks to Marius Tomaschweski
+- improved error reporting for $WorkDirectory
+ non-existance and other detectable problems are now reported,
+ and the work directory is NOT set in this case
- bugfix: pmsnare causded abort under some conditions
- bugfix: abort if imfile reads file line of more than 64KiB
Thanks to Peter Eisentraut for reporting and analysing this problem.
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221
+- bugfix: queue engine did not properly slow down inputs in FULL_DELAY mode
+ when in disk-assisted mode. This especially affected imfile, which
+ created unnecessarily queue files if a large set of input file data was
+ to process.
+- bugfix: very long running actions could prevent shutdown under some
+ circumstances. This has now been solved, at least for common
+ situations.
+- bugfix: fixed compile problem due to empty structs
+ this occured only on some platforms/compilers. thanks to Dražen Kačar
+ for the fix
---------------------------------------------------------------------------
Version 5.7.3 [V5-BETA] (rgerhards), 2011-02-07
- added support for processing multi-line messages in imfile
@@ -156,6 +180,8 @@ Version 5.6.3 [V5-STABLE] (rgerhards), 2011-01-26
- bugfix: batches which had actions in error were not properly retried in
all cases
- bugfix: imfile did duplicate messages under some circumstances
+- bugfix: testbench was not activated if no Java was present on system
+ ... what actually was a left-over. Java is no longer required.
---------------------------------------------------------------------------
Version 5.6.2 [V5-STABLE] (rgerhards), 2010-11-30
- bugfix: compile failed on systems without epoll_create1()
diff --git a/action.c b/action.c
index 81195e8b..804c4645 100644
--- a/action.c
+++ b/action.c
@@ -500,7 +500,8 @@ static inline void actionSuspend(action_t *pThis, time_t ttNow)
* kind of facility: in the first place, the module should return a proper indication
* of its inability to recover. -- rgerhards, 2010-04-26.
*/
-static rsRetVal actionDoRetry(action_t *pThis, time_t ttNow)
+static inline rsRetVal
+actionDoRetry(action_t *pThis, time_t ttNow, int *pbShutdownImmediate)
{
int iRetries;
int iSleepPeriod;
@@ -510,7 +511,7 @@ static rsRetVal actionDoRetry(action_t *pThis, time_t ttNow)
ASSERT(pThis != NULL);
iRetries = 0;
- while((*pThis->pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) {
+ while((*pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) {
iRet = pThis->pMod->tryResume(pThis->pModData);
if((pThis->iResumeOKinRow > 999) && (pThis->iResumeOKinRow % 1000 == 0)) {
bTreatOKasSusp = 1;
@@ -530,7 +531,7 @@ static rsRetVal actionDoRetry(action_t *pThis, time_t ttNow)
iSleepPeriod = pThis->iResumeInterval;
ttNow += iSleepPeriod; /* not truly exact, but sufficiently... */
srSleep(iSleepPeriod, 0);
- if(*pThis->pbShutdownImmediate) {
+ if(*pbShutdownImmediate) {
ABORT_FINALIZE(RS_RET_FORCE_TERM);
}
}
@@ -551,7 +552,7 @@ finalize_it:
/* try to resume an action -- rgerhards, 2007-08-02
* changed to new action state engine -- rgerhards, 2009-05-07
*/
-static rsRetVal actionTryResume(action_t *pThis)
+static rsRetVal actionTryResume(action_t *pThis, int *pbShutdownImmediate)
{
DEFiRet;
time_t ttNow = NO_TIME_PROVIDED;
@@ -575,7 +576,7 @@ static rsRetVal actionTryResume(action_t *pThis)
if(pThis->eState == ACT_STATE_RTRY) {
if(ttNow == NO_TIME_PROVIDED) /* use cached result if we have it */
datetime.GetTime(&ttNow);
- CHKiRet(actionDoRetry(pThis, ttNow));
+ CHKiRet(actionDoRetry(pThis, ttNow, pbShutdownImmediate));
}
if(Debug && (pThis->eState == ACT_STATE_RTRY ||pThis->eState == ACT_STATE_SUSP)) {
@@ -592,12 +593,12 @@ finalize_it:
* depending on its current state.
* rgerhards, 2009-05-07
*/
-static inline rsRetVal actionPrepare(action_t *pThis)
+static inline rsRetVal actionPrepare(action_t *pThis, int *pbShutdownImmediate)
{
DEFiRet;
assert(pThis != NULL);
- CHKiRet(actionTryResume(pThis));
+ CHKiRet(actionTryResume(pThis, pbShutdownImmediate));
/* if we are now ready, we initialize the transaction and advance
* action state accordingly
@@ -806,14 +807,14 @@ finalize_it:
* rgerhards, 2008-01-28
*/
static inline rsRetVal
-actionProcessMessage(action_t *pThis, msg_t *pMsg, void *actParams)
+actionProcessMessage(action_t *pThis, msg_t *pMsg, void *actParams, int *pbShutdownImmediate)
{
DEFiRet;
ASSERT(pThis != NULL);
ISOBJ_TYPE_assert(pMsg, msg);
- CHKiRet(actionPrepare(pThis));
+ CHKiRet(actionPrepare(pThis, pbShutdownImmediate));
if(pThis->eState == ACT_STATE_ITX)
CHKiRet(actionCallDoAction(pThis, pMsg, actParams));
@@ -840,7 +841,7 @@ finishBatch(action_t *pThis, batch_t *pBatch)
FINALIZE; /* nothing to do */
}
- CHKiRet(actionPrepare(pThis));
+ CHKiRet(actionPrepare(pThis, pBatch->pbShutdownImmediate));
if(pThis->eState == ACT_STATE_ITX) {
iRet = pThis->pMod->mod.om.endTransaction(pThis->pModData);
switch(iRet) {
@@ -907,7 +908,8 @@ tryDoAction(action_t *pAction, batch_t *pBatch, int *pnElem)
&& pBatch->pElem[i].state != BATCH_STATE_DISC
&& ((pAction->bExecWhenPrevSusp == 0) || pBatch->pElem[i].bPrevWasSuspended) ) {
pMsg = (msg_t*) pBatch->pElem[i].pUsrp;
- localRet = actionProcessMessage(pAction, pMsg, pBatch->pElem[i].staticActParams);
+ localRet = actionProcessMessage(pAction, pMsg, pBatch->pElem[i].staticActParams,
+ pBatch->pbShutdownImmediate);
DBGPRINTF("action call returned %d\n", localRet);
/* Note: we directly modify the batch object state, because we know that
* wo do not overwrite BATCH_STATE_DISC indicators!
@@ -1078,7 +1080,6 @@ processBatchMain(action_t *pAction, batch_t *pBatch, int *pbShutdownImmediate)
pbShutdownImmdtSave = pBatch->pbShutdownImmediate;
pBatch->pbShutdownImmediate = pbShutdownImmediate;
- pAction->pbShutdownImmediate = pBatch->pbShutdownImmediate;
CHKiRet(prepareBatch(pAction, pBatch));
/* We now must guard the output module against execution by multiple threads. The
diff --git a/action.h b/action.h
index 56a9d3e0..ae2b5184 100644
--- a/action.h
+++ b/action.h
@@ -88,7 +88,6 @@ struct action_s {
SYNC_OBJ_TOOL; /* required for mutex support */
pthread_mutex_t mutActExec; /* mutex to guard actual execution of doAction for single-threaded modules */
uchar *pszName; /* action name (for documentation) */
- int *pbShutdownImmediate;/* to facilitate shutdown, if var is 1, shut down immediately */
DEF_ATOMIC_HELPER_MUT(mutCAS);
};
diff --git a/configure.ac b/configure.ac
index 9b3a2e82..648f7315 100644
--- a/configure.ac
+++ b/configure.ac
@@ -831,11 +831,6 @@ AC_ARG_ENABLE(testbench,
esac],
[enable_testbench=yes]
)
-if test "$enable_testbench" = "yes"; then
- if test x$HAVE_JAVAC = x; then
- enable_testbench='no'
- fi
-fi
AM_CONDITIONAL(ENABLE_TESTBENCH, test x$enable_testbench = xyes)
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index a9096dca..ea53de05 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -291,13 +291,13 @@ CODESTARTrunInput
pthread_cleanup_push(inputModuleCleanup, NULL);
while(glbl.GetGlobalInputTermState() == 0) {
do {
- if(glbl.GetGlobalInputTermState() == 1)
- break; /* terminate input! */
bHadFileData = 0;
for(i = 0 ; i < iFilPtr ; ++i) {
+ if(glbl.GetGlobalInputTermState() == 1)
+ break; /* terminate input! */
pollFile(&files[i], &bHadFileData);
}
- } while(iFilPtr > 1 && bHadFileData == 1); /* warning: do...while()! */
+ } while(iFilPtr > 1 && bHadFileData == 1 && glbl.GetGlobalInputTermState() == 0); /* warning: do...while()! */
/* Note: the additional 10ns wait is vitally important. It guards rsyslog against totally
* hogging the CPU if the users selects a polling interval of 0 seconds. It doesn't hurt any
diff --git a/runtime/datetime.h b/runtime/datetime.h
index 82bd415b..70bbf416 100644
--- a/runtime/datetime.h
+++ b/runtime/datetime.h
@@ -28,6 +28,7 @@
/* the datetime object */
typedef struct datetime_s {
+ char dummy;
} datetime_t;
diff --git a/runtime/errmsg.h b/runtime/errmsg.h
index 799954fb..ac7018b3 100644
--- a/runtime/errmsg.h
+++ b/runtime/errmsg.h
@@ -30,6 +30,7 @@
/* the errmsg object */
typedef struct errmsg_s {
+ char dummy;
} errmsg_t;
diff --git a/runtime/expr.h b/runtime/expr.h
index 974b71ec..1afe1a1f 100644
--- a/runtime/expr.h
+++ b/runtime/expr.h
@@ -30,6 +30,7 @@
/* a node inside an expression tree */
typedef struct exprNode_s {
+ char dummy;
} exprNode_t;
diff --git a/runtime/glbl.c b/runtime/glbl.c
index 7dc17df4..0114b1ac 100644
--- a/runtime/glbl.c
+++ b/runtime/glbl.c
@@ -31,6 +31,9 @@
#include "config.h"
#include <stdlib.h>
#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <assert.h>
#include "rsyslog.h"
@@ -40,6 +43,7 @@
#include "glbl.h"
#include "prop.h"
#include "atomic.h"
+#include "errmsg.h"
/* some defaults */
#ifndef DFLT_NETSTRM_DRVR
@@ -49,6 +53,7 @@
/* static data */
DEFobjStaticHelpers
DEFobjCurrIf(prop)
+DEFobjCurrIf(errmsg)
/* static data
* For this object, these variables are obviously what makes the "meat" of the
@@ -147,6 +152,35 @@ static void SetGlobalInputTermination(void)
}
+/* This function is used to set the global work directory name.
+ * It verifies that the provided directory actually exists and
+ * emits an error message if not.
+ * rgerhards, 2011-02-16
+ */
+static rsRetVal setWorkDir(void __attribute__((unused)) *pVal, uchar *pNewVal)
+{
+ DEFiRet;
+ struct stat sb;
+
+ if(stat((char*) pNewVal, &sb) != 0) {
+ errmsg.LogError(0, RS_RET_ERR_WRKDIR, "$WorkDirectory: %s can not be "
+ "accessed, probably does not exist - directive ignored", pNewVal);
+ ABORT_FINALIZE(RS_RET_ERR_WRKDIR);
+ }
+
+ if(!S_ISDIR(sb.st_mode)) {
+ errmsg.LogError(0, RS_RET_ERR_WRKDIR, "$WorkDirectory: %s not a directory - directive ignored",
+ pNewVal);
+ ABORT_FINALIZE(RS_RET_ERR_WRKDIR);
+ }
+
+ free(pszWorkDir);
+ pszWorkDir = pNewVal;
+
+finalize_it:
+ RETiRet;
+}
+
/* return our local hostname. if it is not set, "[localhost]" is returned
*/
static uchar*
@@ -354,9 +388,10 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
BEGINAbstractObjClassInit(glbl, 1, OBJ_IS_CORE_MODULE) /* class, version */
/* request objects we use */
CHKiRet(objUse(prop, CORE_COMPONENT));
+ CHKiRet(objUse(errmsg, CORE_COMPONENT));
/* register config handlers (TODO: we need to implement a way to unregister them) */
- CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, NULL, &pszWorkDir, NULL, eConfObjGlobal));
+ CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, setWorkDir, NULL, NULL, eConfObjGlobal));
CHKiRet(regCfSysLineHdlr((uchar *)"dropmsgswithmaliciousdnsptrrecords", 0, eCmdHdlrBinary, NULL, &bDropMalPTRMsgs, NULL, eConfObjGlobal));
CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdriver", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvr, NULL, eConfObjGlobal));
CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdrivercafile", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvrCAF, NULL, eConfObjGlobal));
diff --git a/runtime/modules.h b/runtime/modules.h
index 9569512b..a78cd6f1 100644
--- a/runtime/modules.h
+++ b/runtime/modules.h
@@ -123,6 +123,7 @@ struct modInfo_s {
rsRetVal (*restoreScope)(void);
} om;
struct { /* data for library modules */
+ char dummy;
} lm;
struct { /* data for parser modules */
rsRetVal (*parse)(msg_t*);
diff --git a/runtime/queue.c b/runtime/queue.c
index e4922f37..76327f6a 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -246,6 +246,7 @@ qqueueAdviseMaxWorkers(qqueue_t *pThis)
if(!pThis->bEnqOnly) {
if(pThis->bIsDA && getLogicalQueueSize(pThis) >= pThis->iHighWtrMrk) {
+ DBGOPRINT((obj_t*) pThis, "(re)activating DA worker\n");
wtpAdviseMaxWorkers(pThis->pWtpDA, 1); /* disk queues have always one worker */
} else {
if(getLogicalQueueSize(pThis) == 0) {
@@ -1211,7 +1212,6 @@ rsRetVal qqueueConstruct(qqueue_t **ppThis, queueType_t qType, int iWorkerThread
/* set some water marks so that we have useful defaults if none are set specifically */
pThis->iFullDlyMrk = iMaxQueueSize - (iMaxQueueSize / 100) * 3; /* default 97% */
pThis->iLightDlyMrk = iMaxQueueSize - (iMaxQueueSize / 100) * 30; /* default 70% */
-
pThis->lenSpoolDir = ustrlen(pThis->pszSpoolDir);
pThis->iMaxFileSize = 1024 * 1024; /* default is 1 MiB */
pThis->iQueueSize = 0;
@@ -1497,7 +1497,7 @@ DequeueConsumable(qqueue_t *pThis, wti_t *pWti)
* now that we dequeue batches of pointers, this is much less an issue...
* rgerhards, 2009-04-22
*/
- if(iQueueSize < pThis->iFullDlyMrk / 2) {
+ if(iQueueSize < pThis->iFullDlyMrk / 2 || glbl.GetGlobalInputTermState() == 1) {
pthread_cond_broadcast(&pThis->belowFullDlyWtrMrk);
}
@@ -1819,6 +1819,7 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
{
DEFiRet;
uchar pszBuf[64];
+ int wrk;
uchar *qName;
size_t lenBuf;
@@ -1841,7 +1842,6 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
}
pthread_mutex_init(&pThis->mutThrdMgmt, NULL);
- pthread_cond_init (&pThis->condDAReady, NULL);
pthread_cond_init (&pThis->notFull, NULL);
pthread_cond_init (&pThis->notEmpty, NULL);
pthread_cond_init (&pThis->belowFullDlyWtrMrk, NULL);
@@ -1850,6 +1850,16 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
/* call type-specific constructor */
CHKiRet(pThis->qConstruct(pThis)); /* this also sets bIsDA */
+ /* re-adjust some params if required */
+ if(pThis->bIsDA) {
+ /* if we are in DA mode, we must make sure full delayable messages do not
+ * initiate going to disk!
+ */
+ wrk = pThis->iHighWtrMrk - (pThis->iHighWtrMrk / 100) * 50; /* 50% of high water mark */
+ if(wrk < pThis->iFullDlyMrk)
+ pThis->iFullDlyMrk = wrk;
+ }
+
DBGOPRINT((obj_t*) pThis, "type %d, enq-only %d, disk assisted %d, maxFileSz %lld, lqsize %d, pqsize %d, child %d, "
"full delay %d, light delay %d, deq batch size %d starting\n",
pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->iMaxFileSize,
@@ -2129,7 +2139,6 @@ CODESTARTobjDestruct(qqueue)
free(pThis->mut);
}
pthread_mutex_destroy(&pThis->mutThrdMgmt);
- pthread_cond_destroy(&pThis->condDAReady);
pthread_cond_destroy(&pThis->notFull);
pthread_cond_destroy(&pThis->notEmpty);
pthread_cond_destroy(&pThis->belowFullDlyWtrMrk);
diff --git a/runtime/queue.h b/runtime/queue.h
index 38e248cd..97057180 100644
--- a/runtime/queue.h
+++ b/runtime/queue.h
@@ -124,7 +124,6 @@ struct queue_s {
pthread_cond_t notFull, notEmpty;
pthread_cond_t belowFullDlyWtrMrk; /* below eFLOWCTL_FULL_DELAY watermark */
pthread_cond_t belowLightDlyWtrMrk; /* below eFLOWCTL_FULL_DELAY watermark */
- pthread_cond_t condDAReady;/* signalled when the DA queue is fully initialized and ready for processing */
int bThrdStateChanged; /* at least one thread state has changed if 1 */
/* end sync variables */
/* the following variables are always present, because they
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index be4707c4..9d3d0289 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -347,6 +347,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_ERR_HDFS_WRITE = -2178, /**< error writing to HDFS */
RS_RET_ERR_HDFS_OPEN = -2179, /**< error during hdfsOpen (e.g. file does not exist) */
RS_RET_FILE_NOT_SPECIFIED = -2180, /**< file name not configured where this was required */
+ RS_RET_ERR_WRKDIR = -2181, /**< problems with the rsyslog working directory */
RS_RET_INVLD_CONF_OBJ= -2200, /**< invalid config object (e.g. $Begin conf statement) */
RS_RET_ERR_LIBEE_INIT = -2201, /**< cannot obtain libee ctx */
diff --git a/threads.c b/threads.c
index d4e14527..11c9a1d8 100644
--- a/threads.c
+++ b/threads.c
@@ -101,12 +101,14 @@ thrdTerminateNonCancel(thrdInfo_t *pThis)
do {
d_pthread_mutex_lock(&pThis->mutThrd);
pthread_kill(pThis->thrdID, SIGTTIN);
- timeoutComp(&tTimeout, 10); /* a fixed 10ms timeout, do after lock (may take long!) */
+ timeoutComp(&tTimeout, 1000); /* a fixed 1sec timeout */
ret = d_pthread_cond_timedwait(&pThis->condThrdTerm, &pThis->mutThrd, &tTimeout);
d_pthread_mutex_unlock(&pThis->mutThrd);
if(Debug) {
if(ret == ETIMEDOUT) {
- dbgprintf("input thread term: had a timeout waiting on thread termination\n");
+ dbgprintf("input thread term: timeout expired waiting on thread termination - canceling\n");
+ pthread_cancel(pThis->thrdID);
+ pThis->bIsActive = 0;
} else if(ret == 0) {
dbgprintf("input thread term: thread returned normally and is terminated\n");
} else {
@@ -194,8 +196,8 @@ static void* thrdStarter(void *arg)
* keep the thread debugger happer, it would not really be necessary with
* the logic we employ...)
*/
- pThis->bIsActive = 0;
d_pthread_mutex_lock(&pThis->mutThrd);
+ pThis->bIsActive = 0;
pthread_cond_signal(&pThis->condThrdTerm);
d_pthread_mutex_unlock(&pThis->mutThrd);
diff --git a/tools/iminternal.c b/tools/iminternal.c
index bd1fa128..12534ba0 100644
--- a/tools/iminternal.c
+++ b/tools/iminternal.c
@@ -89,7 +89,7 @@ finalize_it:
* The interface of this function is modelled after syslogd/logmsg(),
* for which it is an "replacement".
*/
-rsRetVal iminternalAddMsg(int pri, msg_t *pMsg)
+rsRetVal iminternalAddMsg(msg_t *pMsg)
{
DEFiRet;
iminternal_t *pThis;
@@ -98,7 +98,6 @@ rsRetVal iminternalAddMsg(int pri, msg_t *pMsg)
CHKiRet(iminternalConstruct(&pThis));
- pThis->pri = pri;
pThis->pMsg = pMsg;
CHKiRet(llAppend(&llMsgs, NULL, (void*) pThis));
@@ -118,7 +117,7 @@ finalize_it:
* from the list and return it to the caller. The caller is
* responsible for freeing the message!
*/
-rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg)
+rsRetVal iminternalRemoveMsg(msg_t **ppMsg)
{
DEFiRet;
iminternal_t *pThis;
@@ -128,7 +127,6 @@ rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg)
assert(ppMsg != NULL);
CHKiRet(llGetNextElt(&llMsgs, &llCookie, (void*)&pThis));
- *pPri = pThis->pri;
*ppMsg = pThis->pMsg;
pThis->pMsg = NULL; /* we do no longer own it - important for destructor */
diff --git a/tools/iminternal.h b/tools/iminternal.h
index f1062a15..8a9e2506 100644
--- a/tools/iminternal.h
+++ b/tools/iminternal.h
@@ -33,7 +33,6 @@
* The short name is cslch (Configfile SysLine CommandHandler)
*/
struct iminternal_s { /* config file sysline parse entry */
- int pri;
msg_t *pMsg; /* the message (in all its glory) */
};
typedef struct iminternal_s iminternal_t;
@@ -41,8 +40,8 @@ typedef struct iminternal_s iminternal_t;
/* prototypes */
rsRetVal modInitIminternal(void);
rsRetVal modExitIminternal(void);
-rsRetVal iminternalAddMsg(int pri, msg_t *pMsg);
+rsRetVal iminternalAddMsg(msg_t *pMsg);
rsRetVal iminternalHaveMsgReady(int* pbHaveOne);
-rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg);
+rsRetVal iminternalRemoveMsg(msg_t **ppMsg);
#endif /* #ifndef IMINTERNAL_H_INCLUDED */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 1ce810bf..9d18ce7d 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -571,7 +571,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
}
if(bHaveMainQueue == 0) { /* not yet in queued mode */
- iminternalAddMsg(pri, pMsg);
+ iminternalAddMsg(pMsg);
} else {
/* we have the queue, so we can simply provide the
* message to the queue engine.
@@ -1865,10 +1865,9 @@ void sigttin_handler()
*/
static inline void processImInternal(void)
{
- int iPri;
msg_t *pMsg;
- while(iminternalRemoveMsg(&iPri, &pMsg) == RS_RET_OK) {
+ while(iminternalRemoveMsg(&pMsg) == RS_RET_OK) {
submitMsg(pMsg);
}
}