From 03d1de9813697135769be2b1730aef4e3ce7c1bb Mon Sep 17 00:00:00 2001 From: Pat Mills Date: Fri, 21 Mar 2025 12:26:03 -0400 Subject: [PATCH] use data race safe gmtime variant as in NormSession::OnReportTimeout --- src/common/normSession.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/normSession.cpp b/src/common/normSession.cpp index f0dae72..6c73855 100755 --- a/src/common/normSession.cpp +++ b/src/common/normSession.cpp @@ -2628,7 +2628,14 @@ void NormTrace(const struct timeval ¤tTime, 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 ",