diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/date.c | 2 | ||||
-rw-r--r-- | src/os_unix.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/date.c b/src/date.c index c0744e8c7..f9411ea5b 100644 --- a/src/date.c +++ b/src/date.c @@ -427,7 +427,9 @@ static int osLocaltime(time_t *t, struct tm *pTm){ #if (!defined(HAVE_LOCALTIME_R) || !HAVE_LOCALTIME_R) \ && (!defined(HAVE_LOCALTIME_S) || !HAVE_LOCALTIME_S) struct tm *pX; +#if SQLITE_THREADSAFE>0 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); +#endif sqlite3_mutex_enter(mutex); pX = localtime(t); #ifndef SQLITE_OMIT_BUILTIN_TEST diff --git a/src/os_unix.c b/src/os_unix.c index 682e74c95..f9a12a2fb 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3672,7 +3672,7 @@ static void unixShmPurge(unixFile *pFd){ if( p && p->nRef==0 ){ int i; assert( p->pInode==pFd->pInode ); - if( p->mutex ) sqlite3_mutex_free(p->mutex); + sqlite3_mutex_free(p->mutex); for(i=0; i<p->nRegion; i++){ if( p->h>=0 ){ munmap(p->apRegion[i], p->szRegion); |