1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

When the asynchronous IO backend opens a file with the EXCLUSIVE flag set, make sure only a single file-descriptor is opened (not one for reading and one for writing). This change fixes #3978. (CVS 6905)

FossilOrigin-Name: 630e669b97a81f9125d4bdc18517738b74eecdec
This commit is contained in:
danielk1977
2009-07-18 11:52:04 +00:00
parent 627a3d6ab4
commit 5368f29ac4
4 changed files with 82 additions and 9 deletions

View File

@ -10,7 +10,7 @@
**
*************************************************************************
**
** $Id: sqlite3async.c,v 1.6 2009/04/30 17:45:34 shane Exp $
** $Id: sqlite3async.c,v 1.7 2009/07/18 11:52:04 danielk1977 Exp $
**
** This file contains the implementation of an asynchronous IO backend
** for SQLite.
@ -1065,7 +1065,10 @@ static int asyncOpen(
if( !isAsyncOpen ){
int flagsout;
rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, &flagsout);
if( rc==SQLITE_OK && (flagsout&SQLITE_OPEN_READWRITE) ){
if( rc==SQLITE_OK
&& (flagsout&SQLITE_OPEN_READWRITE)
&& (flags&SQLITE_OPEN_EXCLUSIVE)==0
){
rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseWrite, flags, 0);
}
if( pOutFlags ){