aboutsummaryrefslogtreecommitdiff
path: root/src/wal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wal.c')
-rw-r--r--src/wal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wal.c b/src/wal.c
index 5399dfda9..8c1027001 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -1462,14 +1462,16 @@ static int walCheckpoint(
}
/* If work was actually accomplished... */
- if( rc==SQLITE_OK && pInfo->nBackfill<mxSafeFrame ){
- pInfo->nBackfill = mxSafeFrame;
- if( mxSafeFrame==pHdr[0].mxFrame && sync_flags ){
+ if( rc==SQLITE_OK ){
+ if( mxSafeFrame==pHdr[0].mxFrame ){
rc = sqlite3OsTruncate(pWal->pDbFd, ((i64)pWal->hdr.nPage*(i64)szPage));
if( rc==SQLITE_OK && sync_flags ){
rc = sqlite3OsSync(pWal->pDbFd, sync_flags);
}
}
+ if( rc==SQLITE_OK ){
+ pInfo->nBackfill = mxSafeFrame;
+ }
}
/* Release the reader lock held while backfilling */