diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-09-03 20:50:49 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-09-03 20:50:49 +0000 |
commit | c681d9f60297ab89c218b4d21f6111c52e9e918c (patch) | |
tree | f1b668b98d3de22fad153332731a89b5ff72aeed /usr.sbin | |
parent | b985e38ec96b2c804156e93838f3c9b0d2249dcf (diff) |
In sendsyslog(2) I got the plural s of messages right. The messages
of syslogd(8) should be alike. syslogd: dropped 1 message
OK lteo@ millert@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d21d25662a9..1ce43911e4b 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.182 2015/09/03 14:50:53 bluhm Exp $ */ +/* $OpenBSD: syslogd.c,v 1.183 2015/09/03 20:50:48 bluhm Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -1155,8 +1155,10 @@ tcp_writecb(struct bufferevent *bufev, void *arg) if (f->f_un.f_forw.f_dropped > 0 && EVBUFFER_LENGTH(f->f_un.f_forw.f_bufev->output) < MAX_TCPBUF) { snprintf(ebuf, sizeof(ebuf), - "syslogd: dropped %d messages to loghost \"%s\"", - f->f_un.f_forw.f_dropped, f->f_un.f_forw.f_loghost); + "syslogd: dropped %d message%s to loghost \"%s\"", + f->f_un.f_forw.f_dropped, + f->f_un.f_forw.f_dropped == 1 ? "" : "s", + f->f_un.f_forw.f_loghost); f->f_un.f_forw.f_dropped = 0; logmsg(LOG_SYSLOG|LOG_WARNING, ebuf, LocalHostName, ADDDATE); } @@ -1863,8 +1865,8 @@ init_signalcb(int signum, short event, void *arg) if (tcpbuf_dropped > 0) { snprintf(ebuf, sizeof(ebuf), - "syslogd: dropped %d messages to remote loghost", - tcpbuf_dropped); + "syslogd: dropped %d message%s to remote loghost", + tcpbuf_dropped, tcpbuf_dropped == 1 ? "" : "s"); tcpbuf_dropped = 0; logmsg(LOG_SYSLOG|LOG_WARNING, ebuf, LocalHostName, ADDDATE); } @@ -1913,8 +1915,8 @@ die(int signo) if (tcpbuf_dropped > 0) { snprintf(ebuf, sizeof(ebuf), - "syslogd: dropped %d messages to remote loghost", - tcpbuf_dropped); + "syslogd: dropped %d message%s to remote loghost", + tcpbuf_dropped, tcpbuf_dropped == 1 ? "" : "s"); tcpbuf_dropped = 0; logmsg(LOG_SYSLOG|LOG_WARNING, ebuf, LocalHostName, ADDDATE); } |