diff options
Diffstat (limited to 'deps/v8/src/base/platform/platform-cygwin.cc')
-rw-r--r-- | deps/v8/src/base/platform/platform-cygwin.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/deps/v8/src/base/platform/platform-cygwin.cc b/deps/v8/src/base/platform/platform-cygwin.cc index a49e28723d..ba0f45667f 100644 --- a/deps/v8/src/base/platform/platform-cygwin.cc +++ b/deps/v8/src/base/platform/platform-cygwin.cc @@ -29,7 +29,8 @@ namespace base { const char* OS::LocalTimezone(double time, TimezoneCache* cache) { if (std::isnan(time)) return ""; time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); - struct tm* t = localtime(&tv); // NOLINT(runtime/threadsafe_fn) + struct tm tm; + struct tm* t = localtime_r(&tv, &tm); if (NULL == t) return ""; return tzname[0]; // The location of the timezone string on Cygwin. } @@ -39,7 +40,8 @@ double OS::LocalTimeOffset(TimezoneCache* cache) { // On Cygwin, struct tm does not contain a tm_gmtoff field. time_t utc = time(NULL); DCHECK(utc != -1); - struct tm* loc = localtime(&utc); // NOLINT(runtime/threadsafe_fn) + struct tm tm; + struct tm* loc = localtime_r(&utc, &tm); DCHECK(loc != NULL); // time - localtime includes any daylight savings offset, so subtract it. return static_cast<double>((mktime(loc) - utc) * msPerSecond - |