mirror of
https://passt.top/passt
synced 2024-12-22 13:45:32 +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:
parent
539dcf5add
commit
a340e5336d
2
util.c
2
util.c
@ -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); \
|
||||
|
Loading…
Reference in New Issue
Block a user