diff options
author | drh <drh@noemail.net> | 2010-06-21 20:19:25 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-06-21 20:19:25 +0000 |
commit | de3c301d634fec415a1e4bfcbf1d6723f73e363d (patch) | |
tree | 8d86da83e50b08cd7f629789aec4136c89f5dda0 /src | |
parent | 0e986f51a45f57d85a6c0fbb8ea9870af3dcd02d (diff) | |
download | sqlite-de3c301d634fec415a1e4bfcbf1d6723f73e363d.tar.gz sqlite-de3c301d634fec415a1e4bfcbf1d6723f73e363d.zip |
Fix comment inside the pager_unlock() routine. Always close the master
journal file before trying to delete it.
FossilOrigin-Name: f820b815c9bff368eb1ccb850966a812151e610e
Diffstat (limited to 'src')
-rw-r--r-- | src/pager.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pager.c b/src/pager.c index a5377d4c3..a02385747 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1221,9 +1221,10 @@ static void pager_unlock(Pager *pPager){ int rc = SQLITE_OK; /* Return code */ int iDc = isOpen(pPager->fd)?sqlite3OsDeviceCharacteristics(pPager->fd):0; - /* Always close the journal file when dropping the database lock. - ** Otherwise, another connection with journal_mode=delete might - ** delete the file out from under us. + /* If the operating system support deletion of open files, then + ** close the journal file when dropping the database lock. Otherwise + ** another connection with journal_mode=delete might delete the file + ** out from under us. */ assert( (PAGER_JOURNALMODE_MEMORY & 5)!=1 ); assert( (PAGER_JOURNALMODE_OFF & 5)!=1 ); @@ -1864,7 +1865,8 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){ zJournal += (sqlite3Strlen30(zJournal)+1); } } - + + sqlite3OsClose(pMaster); rc = sqlite3OsDelete(pVfs, zMaster, 0); delmaster_out: @@ -1874,8 +1876,8 @@ delmaster_out: if( pMaster ){ sqlite3OsClose(pMaster); assert( !isOpen(pJournal) ); + sqlite3_free(pMaster); } - sqlite3_free(pMaster); return rc; } |