/ Check-in [c6e727ab]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make sure the array of overloadable system calls is always correctly sized, regardless of the compile-time configuration. Ticket [bb3a86e890c8e96ab].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c6e727ab3b16e71b0151673bb24b0bafec368ee6
User & Date: drh 2011-04-13 13:42:25
Context
2011-04-13
14:02
Bump the version number to 3.7.6.1 in preparation for a bug-fix release. check-in: 5f0c394a user: drh tags: trunk
13:42
Make sure the array of overloadable system calls is always correctly sized, regardless of the compile-time configuration. Ticket [bb3a86e890c8e96ab]. check-in: c6e727ab user: drh tags: trunk
2011-04-12
01:58
Version 3.7.6. check-in: f9d43fa3 user: drh tags: trunk, release, version-3.7.6
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

   361    361     { "pwrite64",     (sqlite3_syscall_ptr)0,          0  },
   362    362   #endif
   363    363   #define osPwrite64  ((ssize_t(*)(int,const void*,size_t,off_t))\
   364    364                       aSyscall[13].pCurrent)
   365    365   
   366    366   #if SQLITE_ENABLE_LOCKING_STYLE
   367    367     { "fchmod",       (sqlite3_syscall_ptr)fchmod,     0  },
          368  +#else
          369  +  { "fchmod",       (sqlite3_syscall_ptr)0,          0  },
          370  +#endif
   368    371   #define osFchmod    ((int(*)(int,mode_t))aSyscall[14].pCurrent)
   369         -#endif
   370    372   
   371    373   #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
   372    374     { "fallocate",    (sqlite3_syscall_ptr)posix_fallocate,  0 },
   373    375   #else
   374    376     { "fallocate",    (sqlite3_syscall_ptr)0,                0 },
   375    377   #endif
   376    378   #define osFallocate ((int(*)(int,off_t,off_t))aSyscall[15].pCurrent)
................................................................................
  6679   6681   #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
  6680   6682       UNIXVFS("unix-afp",      afpIoFinder ),
  6681   6683       UNIXVFS("unix-nfs",      nfsIoFinder ),
  6682   6684       UNIXVFS("unix-proxy",    proxyIoFinder ),
  6683   6685   #endif
  6684   6686     };
  6685   6687     unsigned int i;          /* Loop counter */
         6688  +
         6689  +  /* Double-check that the aSyscall[] array has been constructed
         6690  +  ** correctly.  See ticket [bb3a86e890c8e96ab] */
         6691  +  assert( ArraySize(aSyscall)==16 );
  6686   6692   
  6687   6693     /* Register all VFSes defined in the aVfs[] array */
  6688   6694     for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
  6689   6695       sqlite3_vfs_register(&aVfs[i], i==0);
  6690   6696     }
  6691   6697     return SQLITE_OK; 
  6692   6698   }