Index: src/base/platform/platform-posix.cc |
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc |
index bb340ab5f95af47f8c455e91ceeb1c182c8d7434..acc6cf33e9bd37a309a05d42ab73f56064b87182 100644 |
--- a/src/base/platform/platform-posix.cc |
+++ b/src/base/platform/platform-posix.cc |
@@ -398,7 +398,8 @@ void OS::ClearTimezoneCache(TimezoneCache* cache) { |
double OS::DaylightSavingsOffset(double time, TimezoneCache*) { |
if (std::isnan(time)) return std::numeric_limits<double>::quiet_NaN(); |
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 std::numeric_limits<double>::quiet_NaN(); |
return t->tm_isdst > 0 ? 3600 * msPerSecond : 0; |
} |