/ Check-in [1abce55a]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 | SQL 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
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: a61786e7 user: drh tags: branch-3.7.6
2011-06-21
15:58
Give the osLocaltime() function file scope in date.c. check-in: 1abce55a 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: 5d4b0c5b user: drh tags: branch-3.7.6
Changes
Hide Diffs Unified Diffs 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);