syslogd: Record time of first occurrence of a message
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
0a8cecfa84
commit
a9758d1559
@ -1648,7 +1648,6 @@ static void fprintlog_first(struct filed *f, struct buf_msg *buffer)
|
|||||||
int iovcnt;
|
int iovcnt;
|
||||||
|
|
||||||
logit("Called fprintlog_first(), ");
|
logit("Called fprintlog_first(), ");
|
||||||
f->f_prevcount = 0;
|
|
||||||
|
|
||||||
if (!memcmp(&buffer->timestamp, &zero, sizeof(zero))) {
|
if (!memcmp(&buffer->timestamp, &zero, sizeof(zero))) {
|
||||||
struct logtime timestamp_now;
|
struct logtime timestamp_now;
|
||||||
@ -1662,6 +1661,9 @@ static void fprintlog_first(struct filed *f, struct buf_msg *buffer)
|
|||||||
buffer->timestamp = timestamp_now;
|
buffer->timestamp = timestamp_now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f->f_time = now;
|
||||||
|
f->f_prevcount = 0;
|
||||||
|
|
||||||
if (f->f_flags & RFC5424)
|
if (f->f_flags & RFC5424)
|
||||||
iovcnt = fmt5424(buffer, RFC5424_DATEFMT, iov, NELEMS(iov));
|
iovcnt = fmt5424(buffer, RFC5424_DATEFMT, iov, NELEMS(iov));
|
||||||
else if (f->f_flags & RFC3164)
|
else if (f->f_flags & RFC3164)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user