1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Modify the sqlite3OsFileControl() interface to detect unopened sqlite3_file

objects and return SQLITE_NOTFOUND.

FossilOrigin-Name: 1fc72b707d4f4df049c19b023ae3f70cb45d6a6768bb68efc519cfdcd2d2ecda
This commit is contained in:
drh
2018-03-29 13:47:01 +00:00
parent d88690bd10
commit afb39a4cdc
6 changed files with 27 additions and 37 deletions

View File

@@ -142,10 +142,11 @@ int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
DO_OS_MALLOC_TEST(id);
}
#endif
if( id->pMethods==0 ) return SQLITE_NOTFOUND;
return id->pMethods->xFileControl(id, op, pArg);
}
void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
(void)id->pMethods->xFileControl(id, op, pArg);
if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg);
}
int sqlite3OsSectorSize(sqlite3_file *id){