diff options
author | Michael Biebl <biebl@debian.org> | 2012-04-05 18:43:40 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2012-04-05 18:43:40 +0200 |
commit | 09756e0e7c8b90e7f8621c37fe480c7683c8a8cb (patch) | |
tree | a5e89673a291b849ee7ce33acf4e8aa61dd4e768 /runtime | |
parent | c1860fd74db97b8311e5d8f018ded8145fb0b0f5 (diff) | |
download | rsyslog-09756e0e7c8b90e7f8621c37fe480c7683c8a8cb.tar.gz |
Imported Upstream version 5.8.10upstream/5.8.10
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/queue.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/queue.c b/runtime/queue.c index 621a4ee..9f31852 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -2018,13 +2018,16 @@ static rsRetVal qqueuePersist(qqueue_t *pThis, int bIsCheckpoint) CHKiRet(obj.EndSerialize(psQIF)); /* now persist the stream info */ - CHKiRet(strm.Serialize(pThis->tVars.disk.pWrite, psQIF)); - CHKiRet(strm.Serialize(pThis->tVars.disk.pReadDel, psQIF)); + if(pThis->tVars.disk.pWrite != NULL) + CHKiRet(strm.Serialize(pThis->tVars.disk.pWrite, psQIF)); + if(pThis->tVars.disk.pReadDel != NULL) + CHKiRet(strm.Serialize(pThis->tVars.disk.pReadDel, psQIF)); /* tell the input file object that it must not delete the file on close if the queue * is non-empty - but only if we are not during a simple checkpoint */ - if(bIsCheckpoint != QUEUE_CHECKPOINT) { + if(bIsCheckpoint != QUEUE_CHECKPOINT + && pThis->tVars.disk.pReadDel != NULL) { CHKiRet(strm.SetbDeleteOnClose(pThis->tVars.disk.pReadDel, 0)); } @@ -2116,7 +2119,8 @@ CODESTARTobjDestruct(qqueue) * direct queue - because in both cases we have none... ;) * with a child! -- rgerhards, 2008-01-28 */ - if(pThis->qType != QUEUETYPE_DIRECT && !pThis->bEnqOnly && pThis->pqParent == NULL) + if(pThis->qType != QUEUETYPE_DIRECT && !pThis->bEnqOnly && pThis->pqParent == NULL + && pThis->pWtpReg != NULL) ShutdownWorkers(pThis); if(pThis->bIsDA && getPhysicalQueueSize(pThis) > 0 && pThis->bSaveOnShutdown) { |