syslogd: Record time of first occurrence of a message

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-11-29 10:29:48 +01:00
parent 0a8cecfa84
commit a9758d1559

View File

@ -1648,7 +1648,6 @@ static void fprintlog_first(struct filed *f, struct buf_msg *buffer)
int iovcnt;
logit("Called fprintlog_first(), ");
f->f_prevcount = 0;
if (!memcmp(&buffer->timestamp, &zero, sizeof(zero))) {
struct logtime timestamp_now;
@ -1662,6 +1661,9 @@ static void fprintlog_first(struct filed *f, struct buf_msg *buffer)
buffer->timestamp = timestamp_now;
}
f->f_time = now;
f->f_prevcount = 0;
if (f->f_flags & RFC5424)
iovcnt = fmt5424(buffer, RFC5424_DATEFMT, iov, NELEMS(iov));
else if (f->f_flags & RFC3164)