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;