aboutsummaryrefslogtreecommitdiff
path: root/src/test_async.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test_async.c')
-rw-r--r--src/test_async.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/test_async.c b/src/test_async.c
index 729085072..689fb5a26 100644
--- a/src/test_async.c
+++ b/src/test_async.c
@@ -10,7 +10,7 @@
**
*************************************************************************
**
-** $Id: test_async.c,v 1.50 2009/03/24 16:27:09 drh Exp $
+** $Id: test_async.c,v 1.51 2009/03/25 14:24:42 drh Exp $
**
** This file contains an example implementation of an asynchronous IO
** backend for SQLite.
@@ -419,7 +419,7 @@ struct AsyncFileData {
sqlite3_file *pBaseWrite; /* Write handle to the underlying Os file */
AsyncFileLock lock; /* Lock state for this handle */
AsyncLock *pLock; /* AsyncLock object for this file system entry */
- AsyncWrite close;
+ AsyncWrite closeOp; /* Preallocated close operation */
};
/*
@@ -701,7 +701,7 @@ static int asyncClose(sqlite3_file *pFile){
p->lock.eLock = 0;
pthread_mutex_unlock(&async.lockMutex);
- addAsyncWrite(&p->close);
+ addAsyncWrite(&p->closeOp);
return SQLITE_OK;
}
@@ -1097,8 +1097,8 @@ static int asyncOpen(
pData->pBaseRead = (sqlite3_file*)z;
z += pVfs->szOsFile;
pData->pBaseWrite = (sqlite3_file*)z;
- pData->close.pFileData = pData;
- pData->close.op = ASYNC_CLOSE;
+ pData->closeOp.pFileData = pData;
+ pData->closeOp.op = ASYNC_CLOSE;
if( zName ){
z += pVfs->szOsFile;
@@ -1186,6 +1186,9 @@ static int asyncOpen(
sqlite3_free(pData);
}
}
+ if( rc!=SQLITE_OK ){
+ p->pMethod = 0;
+ }
return rc;
}