Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/syslogd/syslogd.c
Show First 20 Lines • Show All 1,014 Lines • ▼ Show 20 Lines | for (f = Files; f; f = f->f_next) { | ||||
if ((flags & MARK) && (now - f->f_time) < MarkInterval / 2) | if ((flags & MARK) && (now - f->f_time) < MarkInterval / 2) | ||||
continue; | continue; | ||||
/* | /* | ||||
* suppress duplicate lines to this file | * suppress duplicate lines to this file | ||||
*/ | */ | ||||
if (no_compress - (f->f_type != F_PIPE) < 1 && | if (no_compress - (f->f_type != F_PIPE) < 1 && | ||||
(flags & MARK) == 0 && msglen == f->f_prevlen && | (flags & MARK) == 0 && msglen == f->f_prevlen && | ||||
f->f_prevline && !strcmp(msg, f->f_prevline) && | f->f_prevline[0] && !strcmp(msg, f->f_prevline) && | ||||
!strcasecmp(from, f->f_prevhost)) { | !strcasecmp(from, f->f_prevhost)) { | ||||
(void)strlcpy(f->f_lasttime, timestamp, | (void)strlcpy(f->f_lasttime, timestamp, | ||||
sizeof(f->f_lasttime)); | sizeof(f->f_lasttime)); | ||||
f->f_prevcount++; | f->f_prevcount++; | ||||
dprintf("msg repeated %d times, %ld sec of %d\n", | dprintf("msg repeated %d times, %ld sec of %d\n", | ||||
f->f_prevcount, (long)(now - f->f_time), | f->f_prevcount, (long)(now - f->f_time), | ||||
repeatinterval[f->f_repeatcount]); | repeatinterval[f->f_repeatcount]); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | if (wmsg == NULL) { | ||||
exit(1); | exit(1); | ||||
} | } | ||||
v->iov_base = wmsg; | v->iov_base = wmsg; | ||||
v->iov_len = strlen(msg); | v->iov_len = strlen(msg); | ||||
} else if (f->f_prevcount > 1) { | } else if (f->f_prevcount > 1) { | ||||
v->iov_base = repbuf; | v->iov_base = repbuf; | ||||
v->iov_len = snprintf(repbuf, sizeof repbuf, | v->iov_len = snprintf(repbuf, sizeof repbuf, | ||||
"last message repeated %d times", f->f_prevcount); | "last message repeated %d times", f->f_prevcount); | ||||
} else if (f->f_prevline) { | } else if (f->f_prevline[0]) { | ||||
v->iov_base = f->f_prevline; | v->iov_base = f->f_prevline; | ||||
v->iov_len = f->f_prevlen; | v->iov_len = f->f_prevlen; | ||||
} else { | } else { | ||||
return; | return; | ||||
} | } | ||||
v++; | v++; | ||||
dprintf("Logging to %s", TypeNames[f->f_type]); | dprintf("Logging to %s", TypeNames[f->f_type]); | ||||
▲ Show 20 Lines • Show All 1,573 Lines • Show Last 20 Lines |