aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2018-04-07 09:03:51 +0000
committerEd Schouten <ed@FreeBSD.org>2018-04-07 09:03:51 +0000
commit671d7001679ca9eaf16a9ca7ceb77c139847b4db (patch)
treef2845fdff9481c3143db9953f00349833e569582 /usr.sbin/syslogd
parent8a4a4a43f80e7421c340f59eba927d4890386002 (diff)
downloadsrc-671d7001679ca9eaf16a9ca7ceb77c139847b4db.tar.gz
src-671d7001679ca9eaf16a9ca7ceb77c139847b4db.zip
Fix enough warnings that we can build syslogd on all targets at WARNS=6.
This also fixes the build on MIPS. Reported by: cy (MIPS build failure)
Notes
Notes: svn path=/head/; revision=332165
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r--usr.sbin/syslogd/Makefile2
-rw-r--r--usr.sbin/syslogd/syslogd.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/syslogd/Makefile b/usr.sbin/syslogd/Makefile
index b375c28918f7..a89475cd9bd1 100644
--- a/usr.sbin/syslogd/Makefile
+++ b/usr.sbin/syslogd/Makefile
@@ -11,8 +11,6 @@ SRCS= syslogd.c ttymsg.c
LIBADD= util
-WARNS?= 3
-
.if ${MK_INET_SUPPORT} != "no"
CFLAGS+= -DINET
.endif
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 7e42c936ea76..6074252bdff8 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -581,7 +581,7 @@ main(int argc, char *argv[])
else if (ch == 'p') {
mode = DEFFILEMODE;
pflag = 1;
- } else if (ch == 'S') {
+ } else {
mode = S_IRUSR | S_IWUSR;
Sflag = 1;
}
@@ -931,7 +931,7 @@ static void
parsemsg_rfc5424(const char *from, int pri, char *msg)
{
const struct logtime *timestamp;
- struct logtime timestamp_remote = { 0 };
+ struct logtime timestamp_remote;
const char *omsg, *hostname, *app_name, *procid, *msgid,
*structured_data;
char line[MAXLINE + 1];
@@ -971,6 +971,7 @@ parsemsg_rfc5424(const char *from, int pri, char *msg)
dest = v; \
} while (0)
/* Date and time. */
+ memset(&timestamp_remote, 0, sizeof(timestamp_remote));
PARSE_NUMBER(timestamp_remote.tm.tm_year, 4, 0, 9999);
timestamp_remote.tm.tm_year -= 1900;
PARSE_CHAR("TIMESTAMP", '-');
@@ -1151,7 +1152,7 @@ parsemsg_rfc3164(const char *from, int pri, char *msg)
{
struct tm tm_parsed;
const struct logtime *timestamp;
- struct logtime timestamp_remote = { 0 };
+ struct logtime timestamp_remote;
const char *app_name, *procid;
size_t i, msglen;
char line[MAXLINE + 1];
@@ -1187,6 +1188,7 @@ parsemsg_rfc3164(const char *from, int pri, char *msg)
timestamp_remote.tm = tm_parsed;
timestamp_remote.tm.tm_year = year;
timestamp_remote.tm.tm_isdst = -1;
+ timestamp_remote.usec = 0;
if (mktime(&timestamp_remote.tm) <
t_now + 7 * 24 * 60 * 60)
break;