From: Martin Mares Date: Fri, 20 Feb 2009 17:08:46 +0000 (+0100) Subject: Logging: Let log_msg contain the current time as a timeval, too. X-Git-Tag: holmes-import~47 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=53e1f544385cb04b518b64facd56a653c286a85b;p=libucw.git Logging: Let log_msg contain the current time as a timeval, too. --- 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;