diff options
author | dan <dan@noemail.net> | 2012-01-24 10:08:26 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2012-01-24 10:08:26 +0000 |
commit | 42829635a239f41e8a4cae1d7413f7251366071b (patch) | |
tree | 434e419568b87d53e6d9633d2438176f553a4c5e /ext/async/sqlite3async.c | |
parent | aa538a581a21753e8b22ed977c576d67dc0b4e83 (diff) | |
download | sqlite-42829635a239f41e8a4cae1d7413f7251366071b.tar.gz sqlite-42829635a239f41e8a4cae1d7413f7251366071b.zip |
Changes to the async-io module so that the xFileControl method returns SQLITE_NOTFOUND when a file-control is not recognized and so that it adds the second nul-terminator byte to filenames passed to the xOpen method of the underlying VFS.
FossilOrigin-Name: 7036886e83fccad32187668306ee2ae3f950dfce
Diffstat (limited to 'ext/async/sqlite3async.c')
-rw-r--r-- | ext/async/sqlite3async.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/async/sqlite3async.c b/ext/async/sqlite3async.c index a351eaa92..0814da7c7 100644 --- a/ext/async/sqlite3async.c +++ b/ext/async/sqlite3async.c @@ -944,7 +944,7 @@ static int asyncFileControl(sqlite3_file *id, int op, void *pArg){ return SQLITE_OK; } } - return SQLITE_ERROR; + return SQLITE_NOTFOUND; } /* @@ -1044,15 +1044,18 @@ static int asyncOpen( char *z; int isAsyncOpen = doAsynchronousOpen(flags); - /* If zName is NULL, then the upper layer is requesting an anonymous file */ + /* If zName is NULL, then the upper layer is requesting an anonymous file. + ** Otherwise, allocate enough space to make a copy of the file name (along + ** with the second nul-terminator byte required by xOpen). + */ if( zName ){ - nName = (int)strlen(zName)+1; + nName = (int)strlen(zName); } nByte = ( sizeof(AsyncFileData) + /* AsyncFileData structure */ 2 * pVfs->szOsFile + /* AsyncFileData.pBaseRead and pBaseWrite */ - nName /* AsyncFileData.zName */ + nName + 2 /* AsyncFileData.zName */ ); z = sqlite3_malloc(nByte); if( !z ){ |