1
0
mirror of https://passt.top/passt synced 2024-07-01 23:42:41 +00:00

util: Fix millisecond logging timestamp calculation

Four sub-second digits means 0.1ms units: divide nanoseconds by
10^5, not 10^6.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-08-04 01:39:00 +02:00
parent 539dcf5add
commit a340e5336d

2
util.c
View File

@ -48,7 +48,7 @@ void name(const char *format, ...) { \
tm = gmtime(&tp.tv_sec); \
strftime(ts, sizeof(ts), "%b %d %T.", tm); \
\
fprintf(stderr, "%s%04lu: ", ts, tp.tv_nsec / (1000 * 1000)); \
fprintf(stderr, "%s%04lu: ", ts, tp.tv_nsec / (100 * 1000)); \
va_start(args, format); \
vsyslog(level, format, args); \
va_end(args); \