diff options
Diffstat (limited to 'ext/pdo_sqlite/sqlite/src')
| -rw-r--r-- | ext/pdo_sqlite/sqlite/src/date.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/pdo_sqlite/sqlite/src/date.c b/ext/pdo_sqlite/sqlite/src/date.c index 9146906181..b5c3074243 100644 --- a/ext/pdo_sqlite/sqlite/src/date.c +++ b/ext/pdo_sqlite/sqlite/src/date.c @@ -53,6 +53,7 @@ #include <stdlib.h> #include <assert.h> #include <time.h> +#include "main/php_reentrancy.h" #ifndef SQLITE_OMIT_DATETIME_FUNCS @@ -393,7 +394,7 @@ static void clearYMD_HMS_TZ(DateTime *p){ static double localtimeOffset(DateTime *p){ DateTime x, y; time_t t; - struct tm *pTm; + struct tm *pTm, tmbuf; x = *p; computeYMD_HMS(&x); if( x.Y<1971 || x.Y>=2038 ){ @@ -412,7 +413,8 @@ static double localtimeOffset(DateTime *p){ computeJD(&x); t = (x.rJD-2440587.5)*86400.0 + 0.5; sqlite3OsEnterMutex(); - pTm = localtime(&t); + pTm = php_localtime_r +(&t, &tmbuf); y.Y = pTm->tm_year + 1900; y.M = pTm->tm_mon + 1; y.D = pTm->tm_mday; |
