fix compilation issue
This commit is contained in:
parent
2a274197af
commit
3f3059c920
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: logger.c,v 1.11 2008/10/31 16:12:18 christos Exp $ */
|
||||
/* $NetBSD: logger.c,v 1.12 2008/10/31 20:53:46 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)logger.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: logger.c,v 1.11 2008/10/31 16:12:18 christos Exp $");
|
||||
__RCSID("$NetBSD: logger.c,v 1.12 2008/10/31 20:53:46 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <errno.h>
|
||||
|
@ -119,11 +119,11 @@ main(int argc, char *argv[])
|
|||
for (p = buf, endp = buf + sizeof(buf) - 2; *argv != NULL;) {
|
||||
len = strlen(*argv);
|
||||
if (p + len > endp && p > buf) {
|
||||
syslogp(pri, "%s", "%s", "%s", msgid, sd, buf);
|
||||
syslogp(pri, "%s", msgid, sd, buf);
|
||||
p = buf;
|
||||
}
|
||||
if (len > sizeof(buf) - 1)
|
||||
syslogp(pri, "%s", "%s", "%s", msgid, sd, *argv++);
|
||||
syslogp(pri, "%s", msgid, sd, *argv++);
|
||||
else {
|
||||
if (p != buf)
|
||||
*p++ = ' ';
|
||||
|
@ -132,13 +132,13 @@ main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
if (p != buf)
|
||||
syslogp(pri, "%s", "%s", "%s", msgid, sd, buf);
|
||||
syslogp(pri, "%s", msgid, sd, buf);
|
||||
} else /* TODO: allow syslog-protocol messages from file/stdin
|
||||
* but that will require parsing the line to split
|
||||
* it into three fields.
|
||||
*/
|
||||
while (fgets(buf, sizeof(buf), stdin) != NULL)
|
||||
syslogp(pri, "%s", "%s", "%s", msgid, sd, buf);
|
||||
syslogp(pri, "%s", msgid, sd, buf);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
/* NOTREACHED */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: newsyslog.c,v 1.54 2008/10/31 16:12:19 christos Exp $ */
|
||||
/* $NetBSD: newsyslog.c,v 1.55 2008/10/31 20:55:41 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Andrew Doran <ad@NetBSD.org>
|
||||
|
@ -55,7 +55,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: newsyslog.c,v 1.54 2008/10/31 16:12:19 christos Exp $");
|
||||
__RCSID("$NetBSD: newsyslog.c,v 1.55 2008/10/31 20:55:41 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -667,8 +667,8 @@ log_trimmed(struct conf_entry *log)
|
|||
{
|
||||
FILE *fd;
|
||||
time_t now;
|
||||
char *daytime;
|
||||
char trim_message[] = "log file turned over";
|
||||
const char *daytime;
|
||||
const char trim_message[] = "log file turned over";
|
||||
|
||||
if ((log->flags & CE_BINARY) != 0)
|
||||
return;
|
||||
|
@ -684,13 +684,13 @@ log_trimmed(struct conf_entry *log)
|
|||
char *p;
|
||||
|
||||
/* Truncate domain. */
|
||||
(void)strlcpy(shorthostname, hostname, sizeof(SHORTHOSTNAME));
|
||||
(void)strlcpy(shorthostname, hostname, sizeof(shorthostname));
|
||||
if ((p = strchr(shorthostname, '.')) != NULL)
|
||||
*p = '\0';
|
||||
|
||||
now = time(NULL);
|
||||
daytime = ctime(&now) + 4;
|
||||
daytime[15] = '\0';
|
||||
daytime = p = ctime(&now) + 4;
|
||||
p[15] = '\0';
|
||||
|
||||
(void)fprintf(fd, "%s %s newsyslog[%lu]: %s\n",
|
||||
daytime, hostname, (u_long)getpid(), trim_message);
|
||||
|
|
Loading…
Reference in New Issue