From de1f787307066bea620b3d6631ac68ebf657d561 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 13 Feb 2008 11:44:59 +0000 Subject: - 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 --- queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'queue.c') 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)); -- cgit v1.2.3