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
diff --git a/ext/async/sqlite3async.c b/ext/async/sqlite3async.c
index 9d912b1..11a4761 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 @@
   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 ){