use data race safe gmtime variant as in NormSession::OnReportTimeout (#91)

Co-authored-by: Pat Mills <patrick.m.mills2@boeing.com>
norm-ccd
PM 2025-03-26 01:03:34 -04:00 committed by GitHub
parent 9a613d4150
commit 0c2e151a77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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; struct tm *ct = &timeStruct;
#else #else
time_t secs = (time_t)currentTime.tv_sec; 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 #endif // if/else _WIN32_WCE
PLOG(PL_ALWAYS, "trace>%02d:%02d:%02d.%06lu ", PLOG(PL_ALWAYS, "trace>%02d:%02d:%02d.%06lu ",