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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user