From 53e1f544385cb04b518b64facd56a653c286a85b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 20 Feb 2009 18:08:46 +0100 Subject: [PATCH] Logging: Let log_msg contain the current time as a timeval, too. --- ucw/log.c | 1 + ucw/log.h | 1 + 2 files changed, 2 insertions(+) diff --git a/ucw/log.c b/ucw/log.c index 5a5dc808..419c5e9f 100644 --- a/ucw/log.c +++ b/ucw/log.c @@ -118,6 +118,7 @@ vmsg(uns cat, const char *fmt, va_list args) { /* CAVEAT: These calls are not safe in signal handlers. */ gettimeofday(&tv, NULL); + m.tv = &tv; if (localtime_r(&tv.tv_sec, &tm)) m.tm = &tm; } diff --git a/ucw/log.h b/ucw/log.h index d0f1a9f8..14134111 100644 --- a/ucw/log.h +++ b/ucw/log.h @@ -22,6 +22,7 @@ struct log_msg { char *m; // The formatted message itself, ending with \n\0 int m_len; // Length without the \0 struct tm *tm; // Current time + struct timeval *tv; uns flags; // Category and other flags as passed to msg() char *raw_msg; // Unformatted parts char *stime; -- 2.39.2