SQLite

Check-in [1abce55a1e]
Login

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

Overview
Comment:Give the osLocaltime() function file scope in date.c.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | branch-3.7.6
Files: files | file ages | folders
SHA1: 1abce55a1ed8bce2c3852b726b33bc050590eeb6
User & Date: dan 2011-06-21 15:58:14.587
Context
2011-12-22
18:44
Backport the fixes for Coverity-discovered problems in [1c27d84216], [676acce274], and [f9c4a7c8f4] from trunk to the 3.7.6 branch. (check-in: a61786e760 user: drh tags: branch-3.7.6)
2011-06-21
15:58
Give the osLocaltime() function file scope in date.c. (check-in: 1abce55a1e user: dan tags: branch-3.7.6)
15:15
Backport the localtime() failure fix of ticket [bd484a090c8077] to the 3.7.6 branch. (check-in: 5d4b0c5bfc user: drh tags: branch-3.7.6)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/date.c.
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
** using whatever operating-system specific localtime facility that
** is available.  This routine returns 0 on success and
** non-zero on any kind of error.
**
** If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this
** routine will always fail.
*/
int osLocaltime(time_t *t, struct tm *pTm){
  int rc;
#if (!defined(HAVE_LOCALTIME_R) || !HAVE_LOCALTIME_R) \
      && (!defined(HAVE_LOCALTIME_S) || !HAVE_LOCALTIME_S)
  struct tm *pX;
  sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
  sqlite3_mutex_enter(mutex);
  pX = localtime(t);







|







418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
** using whatever operating-system specific localtime facility that
** is available.  This routine returns 0 on success and
** non-zero on any kind of error.
**
** If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this
** routine will always fail.
*/
static int osLocaltime(time_t *t, struct tm *pTm){
  int rc;
#if (!defined(HAVE_LOCALTIME_R) || !HAVE_LOCALTIME_R) \
      && (!defined(HAVE_LOCALTIME_S) || !HAVE_LOCALTIME_S)
  struct tm *pX;
  sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
  sqlite3_mutex_enter(mutex);
  pX = localtime(t);