summaryrefslogtreecommitdiffstats
path: root/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-13 11:44:59 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-13 11:44:59 +0000
commitde1f787307066bea620b3d6631ac68ebf657d561 (patch)
tree3e4d9d68c294f6daa2b9e85cfbfa8529effb8d55 /queue.c
parent18bea60667f4ced5ac65e91fbd7c7a00ba22b319 (diff)
downloadrsyslog-de1f787307066bea620b3d6631ac68ebf657d561.tar.gz
rsyslog-de1f787307066bea620b3d6631ac68ebf657d561.tar.xz
rsyslog-de1f787307066bea620b3d6631ac68ebf657d561.zip
- fixed a race condition in DoDie() - cosmetic issue in debugging mode,
could not happen in production - added the ability to persist current read location for the file monitor
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/queue.c b/queue.c
index 395f3430..316a4230 100644
--- a/queue.c
+++ b/queue.c
@@ -696,7 +696,6 @@ queueTryLoadPersistedInfo(queue_t *pThis)
/* If we reach this point, we have a .qi file */
CHKiRet(strmConstruct(&psQIF));
- CHKiRet(strmSetDir(psQIF, glblGetWorkDir(), strlen((char*)glblGetWorkDir())));
CHKiRet(strmSettOperationsMode(psQIF, STREAMMODE_READ));
CHKiRet(strmSetsType(psQIF, STREAMTYPE_FILE_SINGLE));
CHKiRet(strmSetFName(psQIF, pszQIFNam, lenQIFNam));
@@ -1710,9 +1709,10 @@ static rsRetVal queuePersist(queue_t *pThis, int bIsCheckpoint)
}
dbgoprint((obj_t*) pThis, "persisting queue to disk, %d entries...\n", queueGetOverallQueueSize(pThis));
+
/* Construct file name */
lenQIFNam = snprintf((char*)pszQIFNam, sizeof(pszQIFNam) / sizeof(uchar), "%s/%s.qi",
- (char*) glblGetWorkDir(), (char*)pThis->pszFilePrefix);
+ (char*) glblGetWorkDir(), (char*)pThis->pszFilePrefix);
if((bIsCheckpoint != QUEUE_CHECKPOINT) && (queueGetOverallQueueSize(pThis) == 0)) {
if(pThis->bNeedDelQIF) {
@@ -1725,7 +1725,6 @@ static rsRetVal queuePersist(queue_t *pThis, int bIsCheckpoint)
}
CHKiRet(strmConstruct(&psQIF));
- CHKiRet(strmSetDir(psQIF, glblGetWorkDir(), strlen((char*)glblGetWorkDir())));
CHKiRet(strmSettOperationsMode(psQIF, STREAMMODE_WRITE));
CHKiRet(strmSetiAddtlOpenFlags(psQIF, O_TRUNC));
CHKiRet(strmSetsType(psQIF, STREAMTYPE_FILE_SINGLE));