From 73503527acd817706490a400bc971a13fb9cd169 Mon Sep 17 00:00:00 2001 From: Horacio Dario Roldan Kasimatis Date: Thu, 5 Sep 2002 21:53:08 +0000 Subject: [PATCH] 2002-09-05 18:46 UTC-0300 Horacio Roldan * source/rdd/dbf1.c synched with 2002-08-31 20:38 UTC-0800 Ron Pinkas * source/rdd/dbf1.c ! Fixed hb_dbfLockFile() to release record locks before attempting to lock the file. 2002-08-31 15:24 UTC-0800 Ron Pinkas * source/rdd/dbf1.c ! Fixed hb_dbfLockRecord() to return success when area alread has file lock. --- harbour/source/rdd/dbf1.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index 270125a540..b6acdc55d9 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -352,6 +352,12 @@ static ERRCODE hb_dbfLockRecord( DBFAREAP pArea, ULONG ulRecNo, BOOL * pResult, if( pArea->lpdbPendingRel ) SELF_FORCEREL( ( AREAP ) pArea ); + if( pArea->fFLocked ) + { + * pResult = TRUE; + return SUCCESS; + } + if( bExclusive ) hb_dbfUnlockAllRecords( pArea ); @@ -406,6 +412,8 @@ static ERRCODE hb_dbfLockFile( DBFAREAP pArea, BOOL * pResult ) if( pArea->lpdbPendingRel ) SELF_FORCEREL( ( AREAP ) pArea ); + hb_dbfUnlockAllRecords( pArea ); + pArea->fFLocked = hb_fsLock( pArea->hDataFile, DBF_LOCKPOS + 1, DBF_LOCKPOS, FL_LOCK ); * pResult = pArea->fFLocked;