openslp/openslp.localtime.diff

14 lines
495 B
Diff

--- ./slpd/slpd_log.c.orig 2014-02-19 17:30:21.682938372 +0000
+++ ./slpd/slpd_log.c 2014-02-19 17:32:04.664938189 +0000
@@ -182,7 +182,9 @@ void SLPDLogBuffer(const char * prefix,
void SLPDLogTime(void)
{
time_t curtime = time(0);
- SLPDLog("%s", ctime(&curtime));
+ struct tm ltm;
+ /* we use localtime_r so that glibc does not re-init the timezone */
+ SLPDLog("%s", asctime(localtime_r(&curtime, &ltm)));
}
/** Logs information about a SrvRequest message to the log file.