aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-08-09 07:51:40 +0000
committerdan <dan@noemail.net>2010-08-09 07:51:40 +0000
commit007820d65d1ed51da24b8edfb9fb1855deb9de3c (patch)
tree8769ab7a27e10c192fdf5b3f4e68ed6594e2c258 /src
parent7a76197f40df894de9d0ff64324013b22233d6ee (diff)
downloadsqlite-007820d65d1ed51da24b8edfb9fb1855deb9de3c.tar.gz
sqlite-007820d65d1ed51da24b8edfb9fb1855deb9de3c.zip
Fix a problem causing the return code of an xSync call to be ignored in wal.c.
FossilOrigin-Name: f1b2b5f9c3a5561ea6108283ae08404106c3f8bc
Diffstat (limited to 'src')
-rw-r--r--src/wal.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/wal.c b/src/wal.c
index 792a65662..5924a6375 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -1567,7 +1567,6 @@ static int walCheckpoint(
if( pInfo->nBackfill<mxSafeFrame
&& (rc = walLockExclusive(pWal, WAL_READ_LOCK(0), 1))==SQLITE_OK
){
- i64 nReq; /* File size hint passed to VFS */
i64 nSize; /* Current size of database file */
u32 nBackfill = pInfo->nBackfill;
@@ -1579,10 +1578,12 @@ static int walCheckpoint(
/* If the database file may grow as a result of this checkpoint, hint
** about the eventual size of the db file to the VFS layer.
*/
- nReq = ((i64)mxPage * szPage);
- rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
- if( rc==SQLITE_OK && nSize<nReq ){
- sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
+ if( rc==SQLITE_OK ){
+ i64 nReq = ((i64)mxPage * szPage);
+ rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
+ if( rc==SQLITE_OK && nSize<nReq ){
+ sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
+ }
}
/* Iterate through the contents of the WAL, copying data to the db file. */