diff options
author | danielk1977 <danielk1977@noemail.net> | 2009-07-18 11:52:04 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2009-07-18 11:52:04 +0000 |
commit | 5368f29ac4e7b598eb9ac912c76628326a5cee36 (patch) | |
tree | cbed43a0aa848984072dc65f18fb48606709b68b /ext/async/sqlite3async.c | |
parent | 627a3d6ab405b5fc8382f3d21a43d41bc3779341 (diff) | |
download | sqlite-5368f29ac4e7b598eb9ac912c76628326a5cee36.tar.gz sqlite-5368f29ac4e7b598eb9ac912c76628326a5cee36.zip |
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
Diffstat (limited to 'ext/async/sqlite3async.c')
-rw-r--r-- | ext/async/sqlite3async.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/async/sqlite3async.c b/ext/async/sqlite3async.c index 9d912b186..11a476129 100644 --- a/ext/async/sqlite3async.c +++ b/ext/async/sqlite3async.c @@ -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 ){ |