aboutsummaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 13a012f678..5d8e64f021 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -60,13 +60,14 @@ _log_prefix(char *buf, size_t buf_len, int severity)
{
time_t t;
struct timeval now;
+ struct tm tm;
size_t n;
int r;
tor_gettimeofday(&now);
t = (time_t)now.tv_sec;
- n = strftime(buf, buf_len, "%b %d %H:%M:%S", localtime(&t));
+ n = strftime(buf, buf_len, "%b %d %H:%M:%S", tor_localtime_r(&t, &tm));
r = tor_snprintf(buf+n, buf_len-n,
".%.3ld [%s] ",
(long)now.tv_usec / 1000, sev_to_string(severity));