mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Move the write failure test in memjrnlCreateFile() to just after the
actual write, thus reducing the number of instances of the test by one. FossilOrigin-Name: 7f00d80c63b15376391f661d872f2b29a970702d
This commit is contained in:
@@ -145,13 +145,14 @@ static int memjrnlCreateFile(MemJournal *p){
|
||||
int nChunk = copy.nChunkSize;
|
||||
i64 iOff = 0;
|
||||
FileChunk *pIter;
|
||||
for(pIter=copy.pFirst; pIter && rc==SQLITE_OK; pIter=pIter->pNext){
|
||||
for(pIter=copy.pFirst; pIter; pIter=pIter->pNext){
|
||||
int nWrite = nChunk;
|
||||
if( pIter==copy.endpoint.pChunk ){
|
||||
nWrite = copy.endpoint.iOffset % copy.nChunkSize;
|
||||
if( nWrite==0 ) nWrite = copy.nChunkSize;
|
||||
}
|
||||
rc = sqlite3OsWrite(pReal, (u8*)pIter->zChunk, nWrite, iOff);
|
||||
if( rc ) break;
|
||||
iOff += nWrite;
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
|
Reference in New Issue
Block a user