summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-11-14 23:39:39 +0000
committerpeter <peter@FreeBSD.org>1995-11-14 23:39:39 +0000
commit130177c924082b70b425ac5ea77e4401d03e7c27 (patch)
tree6bad2a8a22bf3d605bd1dadc9551985497b6c9e6 /usr.sbin
parent5a136ee1a41441cf7e0d86a9e9a71d6138bdcef0 (diff)
downloadFreeBSD-src-130177c924082b70b425ac5ea77e4401d03e7c27.zip
FreeBSD-src-130177c924082b70b425ac5ea77e4401d03e7c27.tar.gz
With the recent 'make install' change in the kernel build makefiles, an
`interesting' feature of syslogd turned up. It calls getbootfile() for each log entry. Since the kernel makefile now changes kern.bootfile when doing a 'make install', it's quite startling to see the syslog lines change. This change makes it call getbootfile() once at startup and cache it, saving a syscall per loop, and keeping something a little more asthetically pleasing in /var/log/messages...
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syslogd/syslogd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 355c9f1..ebf1bc4 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -39,7 +39,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: syslogd.c,v 1.7 1995/10/12 17:18:39 wollman Exp $";
#endif /* not lint */
/*
@@ -192,6 +192,7 @@ int Initialized = 0; /* set when we have initialized ourselves */
int MarkInterval = 20 * 60; /* interval between marks in seconds */
int MarkSeq = 0; /* mark sequence number */
int created_lsock = 0; /* Flag if local socket created */
+char bootfile[MAXLINE+1]; /* booted kernel file */
void cfline __P((char *, struct filed *, char *));
char *cvthname __P((struct sockaddr_in *));
@@ -259,6 +260,7 @@ main(argc, argv)
LocalDomain = p;
} else
LocalDomain = "";
+ (void)strcpy(bootfile, getbootfile());
(void)signal(SIGTERM, die);
(void)signal(SIGINT, Debug ? die : SIG_IGN);
(void)signal(SIGQUIT, Debug ? die : SIG_IGN);
@@ -442,7 +444,7 @@ printsys(msg)
int c, pri, flags;
char *lp, *p, *q, line[MAXLINE + 1];
- (void)strcpy(line, getbootfile());
+ (void)strcpy(line, bootfile);
(void)strcat(line, ": ");
lp = line + strlen(line);
for (p = msg; *p != '\0'; ) {
OpenPOWER on IntegriCloud