diff options
author | Hans-Christoph Steiner <hans@eds.org> | 2012-09-20 18:34:42 -0400 |
---|---|---|
committer | Hans-Christoph Steiner <hans@eds.org> | 2012-09-20 18:34:42 -0400 |
commit | 734b4f890763e4efafe865ba476c43cc8d1a2214 (patch) | |
tree | d561d2fad0788619f4b8e230073f6af1d416934e /ext/async | |
parent | 396b08286e7bb56e0e6440aaf1345c18e72ee22e (diff) | |
parent | 487e15dc239ccdb3344d1c99ce120e872bab4a74 (diff) |
Merge tag 'upstream/2.0.6'
Upstream version 2.0.6
Diffstat (limited to 'ext/async')
-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 a351eaa..0814da7 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 ){ |