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)
This commit is contained in:
parent
8a4a4a43f8
commit
671d700167
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332165
@ -11,8 +11,6 @@ SRCS= syslogd.c ttymsg.c
|
|||||||
|
|
||||||
LIBADD= util
|
LIBADD= util
|
||||||
|
|
||||||
WARNS?= 3
|
|
||||||
|
|
||||||
.if ${MK_INET_SUPPORT} != "no"
|
.if ${MK_INET_SUPPORT} != "no"
|
||||||
CFLAGS+= -DINET
|
CFLAGS+= -DINET
|
||||||
.endif
|
.endif
|
||||||
|
@ -581,7 +581,7 @@ main(int argc, char *argv[])
|
|||||||
else if (ch == 'p') {
|
else if (ch == 'p') {
|
||||||
mode = DEFFILEMODE;
|
mode = DEFFILEMODE;
|
||||||
pflag = 1;
|
pflag = 1;
|
||||||
} else if (ch == 'S') {
|
} else {
|
||||||
mode = S_IRUSR | S_IWUSR;
|
mode = S_IRUSR | S_IWUSR;
|
||||||
Sflag = 1;
|
Sflag = 1;
|
||||||
}
|
}
|
||||||
@ -931,7 +931,7 @@ static void
|
|||||||
parsemsg_rfc5424(const char *from, int pri, char *msg)
|
parsemsg_rfc5424(const char *from, int pri, char *msg)
|
||||||
{
|
{
|
||||||
const struct logtime *timestamp;
|
const struct logtime *timestamp;
|
||||||
struct logtime timestamp_remote = { 0 };
|
struct logtime timestamp_remote;
|
||||||
const char *omsg, *hostname, *app_name, *procid, *msgid,
|
const char *omsg, *hostname, *app_name, *procid, *msgid,
|
||||||
*structured_data;
|
*structured_data;
|
||||||
char line[MAXLINE + 1];
|
char line[MAXLINE + 1];
|
||||||
@ -971,6 +971,7 @@ parsemsg_rfc5424(const char *from, int pri, char *msg)
|
|||||||
dest = v; \
|
dest = v; \
|
||||||
} while (0)
|
} while (0)
|
||||||
/* Date and time. */
|
/* Date and time. */
|
||||||
|
memset(×tamp_remote, 0, sizeof(timestamp_remote));
|
||||||
PARSE_NUMBER(timestamp_remote.tm.tm_year, 4, 0, 9999);
|
PARSE_NUMBER(timestamp_remote.tm.tm_year, 4, 0, 9999);
|
||||||
timestamp_remote.tm.tm_year -= 1900;
|
timestamp_remote.tm.tm_year -= 1900;
|
||||||
PARSE_CHAR("TIMESTAMP", '-');
|
PARSE_CHAR("TIMESTAMP", '-');
|
||||||
@ -1151,7 +1152,7 @@ parsemsg_rfc3164(const char *from, int pri, char *msg)
|
|||||||
{
|
{
|
||||||
struct tm tm_parsed;
|
struct tm tm_parsed;
|
||||||
const struct logtime *timestamp;
|
const struct logtime *timestamp;
|
||||||
struct logtime timestamp_remote = { 0 };
|
struct logtime timestamp_remote;
|
||||||
const char *app_name, *procid;
|
const char *app_name, *procid;
|
||||||
size_t i, msglen;
|
size_t i, msglen;
|
||||||
char line[MAXLINE + 1];
|
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_parsed;
|
||||||
timestamp_remote.tm.tm_year = year;
|
timestamp_remote.tm.tm_year = year;
|
||||||
timestamp_remote.tm.tm_isdst = -1;
|
timestamp_remote.tm.tm_isdst = -1;
|
||||||
|
timestamp_remote.usec = 0;
|
||||||
if (mktime(×tamp_remote.tm) <
|
if (mktime(×tamp_remote.tm) <
|
||||||
t_now + 7 * 24 * 60 * 60)
|
t_now + 7 * 24 * 60 * 60)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user