summaryrefslogtreecommitdiffstats
path: root/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-09 13:27:07 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-09 13:27:07 +0000
commitfd8c6452c8a4d51d39eb511046fca09391138a22 (patch)
treeff95b43b91df5bf2e68c690e38002f30ede5df1c /queue.c
parent2146e340706a9de2be02761b7ad7c28034fb91f3 (diff)
downloadrsyslog-fd8c6452c8a4d51d39eb511046fca09391138a22.tar.gz
rsyslog-fd8c6452c8a4d51d39eb511046fca09391138a22.tar.xz
rsyslog-fd8c6452c8a4d51d39eb511046fca09391138a22.zip
created a generic stream class (for file access)
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/queue.c b/queue.c
index ceb4e3ab..b2a910fc 100644
--- a/queue.c
+++ b/queue.c
@@ -1,4 +1,3 @@
-#include <stdio.h>
// TODO: peekmsg() on first entry, with new/inprogress/deleted entry, destruction in
// call consumer state. Facilitates retaining messages in queue until action could
// be called!
@@ -460,7 +459,7 @@ static rsRetVal qDelDisk(queue_t *pThis, void **ppUsr)
if(pThis->tVars.disk.fRead.fd == -1)
CHKiRet(qDiskOpenFile(pThis, &pThis->tVars.disk.fRead, O_RDONLY, 0600)); // TODO: open modes!
- iRet = objDeserialize((void*) &pMsg, objMsg, &serialStore);
+ iRet = objDeserialize((void*) &pMsg, OBJMsg, &serialStore);
if(iRet == RS_RET_OK)
bRun = 0; /* we are done */
else if(iRet == RS_RET_EOF) {
@@ -696,13 +695,7 @@ rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads,
CHKiRet(pThis->qConstruct(pThis));
finalize_it:
- if(iRet == RS_RET_OK) {
- *ppThis = pThis;
- } else {
- if(pThis != NULL)
- free(pThis);
- }
-
+ OBJCONSTRUCT_CHECK_SUCCESS_AND_CLEANUP
return iRet;
}