use data race safe gmtime variant as in NormSession::OnReportTimeout

pull/91/head
Pat Mills 2025-03-21 12:26:03 -04:00
parent 006f9d29aa
commit 03d1de9813
1 changed files with 8 additions and 1 deletions

View File

@ -2628,7 +2628,14 @@ void NormTrace(const struct timeval &currentTime,
struct tm *ct = &timeStruct;
#else
time_t secs = (time_t)currentTime.tv_sec;
struct tm *ct = gmtime(&secs);
struct tm timeStruct;
#ifdef WIN32
gmtime_s(&timeStruct, &secs);
struct tm *ct = &timeStruct;
#else
struct tm *ct = gmtime_r(&secs, &timeStruct);
#endif
#endif // if/else _WIN32_WCE
PLOG(PL_ALWAYS, "trace>%02d:%02d:%02d.%06lu ",