diff options
author | drh <drh@noemail.net> | 2011-04-13 13:42:25 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-04-13 13:42:25 +0000 |
commit | 2aa5a00e708f46577ab3e6f33fe562183a33f88c (patch) | |
tree | c7f9ea31f2853f2d86806f1c58d32c7d2630b85e /src/os_unix.c | |
parent | ab8fe225cf8c02032562970f25fbadd61504ba1a (diff) | |
download | sqlite-2aa5a00e708f46577ab3e6f33fe562183a33f88c.tar.gz sqlite-2aa5a00e708f46577ab3e6f33fe562183a33f88c.zip |
Make sure the array of overloadable system calls is always correctly
sized, regardless of the compile-time configuration.
Ticket [bb3a86e890c8e96ab].
FossilOrigin-Name: c6e727ab3b16e71b0151673bb24b0bafec368ee6
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index f0e8258f1..744d85776 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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); |