1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Make sure the array of overloadable system calls is always correctly

sized, regardless of the compile-time configuration.
Ticket [bb3a86e890c8e96ab].

FossilOrigin-Name: c6e727ab3b16e71b0151673bb24b0bafec368ee6
This commit is contained in:
drh
2011-04-13 13:42:25 +00:00
parent ab8fe225cf
commit 2aa5a00e70
3 changed files with 14 additions and 8 deletions

View File

@@ -365,8 +365,10 @@ static struct unix_syscall {
#if SQLITE_ENABLE_LOCKING_STYLE
{ "fchmod", (sqlite3_syscall_ptr)fchmod, 0 },
#define osFchmod ((int(*)(int,mode_t))aSyscall[14].pCurrent)
#else
{ "fchmod", (sqlite3_syscall_ptr)0, 0 },
#endif
#define osFchmod ((int(*)(int,mode_t))aSyscall[14].pCurrent)
#if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
{ "fallocate", (sqlite3_syscall_ptr)posix_fallocate, 0 },
@@ -6684,6 +6686,10 @@ int sqlite3_os_init(void){
};
unsigned int i; /* Loop counter */
/* Double-check that the aSyscall[] array has been constructed
** correctly. See ticket [bb3a86e890c8e96ab] */
assert( ArraySize(aSyscall)==16 );
/* Register all VFSes defined in the aVfs[] array */
for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
sqlite3_vfs_register(&aVfs[i], i==0);