1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Add function sqlite3OsFileControlNoFail(), which is the same as sqlite3OsFileControl() except that it does not simulate OOM errors. This saves adding calls to the BenignMalloc() functions around each of the invocations of sqliteOsFileControl() that ignore the return code.

FossilOrigin-Name: af59b182d797642e5ec3ddf291cf62662a136bd1
This commit is contained in:
dan
2012-01-10 16:56:39 +00:00
parent 2bfe5b316c
commit 6f2f19a154
7 changed files with 32 additions and 19 deletions

View File

@@ -101,6 +101,11 @@ int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
DO_OS_MALLOC_TEST(id);
return id->pMethods->xFileControl(id, op, pArg);
}
#ifdef SQLITE_TEST
int sqlite3OsFileControlNoFail(sqlite3_file *id, int op, void *pArg){
return id->pMethods->xFileControl(id, op, pArg);
}
#endif
int sqlite3OsSectorSize(sqlite3_file *id){
int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);