Index: src/wal.c ================================================================== --- src/wal.c +++ src/wal.c @@ -1565,11 +1565,10 @@ } if( pInfo->nBackfillnBackfill; /* Sync the WAL to disk */ if( sync_flags ){ @@ -1577,14 +1576,16 @@ } /* 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 && nSizepDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq); + if( rc==SQLITE_OK ){ + i64 nReq = ((i64)mxPage * szPage); + rc = sqlite3OsFileSize(pWal->pDbFd, &nSize); + if( rc==SQLITE_OK && nSizepDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq); + } } /* Iterate through the contents of the WAL, copying data to the db file. */ while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ i64 iOffset;