summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-26 12:23:17 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-26 12:23:17 +0100
commit5e4f9d5e65d7c0db640f275d5cfb05371b697776 (patch)
tree8ea1e7c05ef015019b4da0cfd27edc6427b960f5 /runtime
parentda53802c96a59a990859706219398dce709ba1b3 (diff)
parent6be07a8f8a3b9b7baf77e42639473e9b1a990e29 (diff)
downloadrsyslog-5e4f9d5e65d7c0db640f275d5cfb05371b697776.tar.gz
rsyslog-5e4f9d5e65d7c0db640f275d5cfb05371b697776.tar.xz
rsyslog-5e4f9d5e65d7c0db640f275d5cfb05371b697776.zip
Merge branch 'master' into queuePartialDeleteBatches
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c2
-rw-r--r--runtime/queue.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 6d5b9cee..623c5b4a 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -288,7 +288,7 @@ static inline void
getInputName(msg_t *pM, uchar **ppsz, int *plen)
{
BEGINfunc
- if(pM == NULL) {
+ if(pM == NULL || pM->pInputName == NULL) {
*ppsz = UCHAR_CONSTANT("");
*plen = 0;
} else {
diff --git a/runtime/queue.c b/runtime/queue.c
index d1eefde6..b4f00446 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1638,18 +1638,21 @@ RateLimiter(qqueue_t *pThis)
}
-/* This dequeues the next batch.
+/* This dequeues the next batch. Note that this function must not be
+ * cancelled, else it will leave back an inconsistent state.
* rgerhards, 2009-05-20
*/
static inline rsRetVal
DequeueForConsumer(qqueue_t *pThis, wti_t *pWti)
{
+ int iCancelStateSave;
DEFiRet;
ISOBJ_TYPE_assert(pThis, qqueue);
ISOBJ_TYPE_assert(pWti, wti);
dbgprintf("YYY: dequeue for consumer\n");
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
CHKiRet(DequeueConsumable(pThis, pWti));
if(pWti->batch.nElem == 0)
@@ -1657,6 +1660,7 @@ dbgprintf("YYY: dequeue for consumer\n");
finalize_it:
+ pthread_setcancelstate(iCancelStateSave, NULL);
RETiRet;
}