diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-22 11:07:10 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-22 11:17:11 -0400 |
commit | bfb39164ce49450fad11611a129dd875acebde54 (patch) | |
tree | 49584d2dda75ed86278d3e93a4dff19f8d039d20 /src/lib/log/torlog.c | |
parent | b2d4e786b7ed2563461513e36c7e75bea1f70be8 (diff) | |
download | tor-bfb39164ce49450fad11611a129dd875acebde54.tar.gz tor-bfb39164ce49450fad11611a129dd875acebde54.zip |
Extract core part of gmtime_r, localtime_r (without logging)
Diffstat (limited to 'src/lib/log/torlog.c')
-rw-r--r-- | src/lib/log/torlog.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/log/torlog.c b/src/lib/log/torlog.c index aec469c53b..fc2f898d87 100644 --- a/src/lib/log/torlog.c +++ b/src/lib/log/torlog.c @@ -41,6 +41,7 @@ #include "lib/string/util_string.h" #include "lib/wallclock/tor_gettimeofday.h" #include "lib/wallclock/approx_time.h" +#include "lib/wallclock/tm_cvt.h" #ifdef HAVE_ANDROID_LOG_H #include <android/log.h> @@ -298,7 +299,8 @@ log_prefix_(char *buf, size_t buf_len, int severity) ms -= ((int)now.tv_usec / 1000) % log_time_granularity; } - n = strftime(buf, buf_len, "%b %d %H:%M:%S", tor_localtime_r(&t, &tm)); + n = strftime(buf, buf_len, "%b %d %H:%M:%S", + tor_localtime_r_msg(&t, &tm, NULL)); r = tor_snprintf(buf+n, buf_len-n, ".%.3i [%s] ", ms, sev_to_string(severity)); |