aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1997-03-14 01:27:02 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1997-03-14 01:27:02 +0000
commitd086327d14d640fcb8ebdbd5d77b2d6a29a52388 (patch)
tree7b17cdbd19753914083c817e5ab9bf76d8182186 /usr.sbin
parent9163ee5e9d71ceecacffbdd948386a1d087cc2e7 (diff)
downloadsrc-d086327d14d640fcb8ebdbd5d77b2d6a29a52388.tar.gz
src-d086327d14d640fcb8ebdbd5d77b2d6a29a52388.zip
Save and restore the state of the variable Initialized inside die().
Otherwise, the shutdown message will print out with 15 NUL bytes in front, due to a missing timestamp.
Notes
Notes: svn path=/head/; revision=23868
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syslogd/syslogd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index bbb65eae5a78..2bc9c76ea7a6 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.20 1997/02/22 16:14:00 peter Exp $";
#endif /* not lint */
/*
@@ -1016,8 +1016,10 @@ die(signo)
int signo;
{
struct filed *f;
+ int was_initialized;
char buf[100];
+ was_initialized = Initialized;
Initialized = 0; /* Don't log SIGCHLDs. */
for (f = Files; f != NULL; f = f->f_next) {
/* flush any pending output */
@@ -1026,6 +1028,7 @@ die(signo)
if (f->f_type == F_PIPE)
(void)close(f->f_file);
}
+ Initialized = was_initialized;
if (signo) {
dprintf("syslogd: exiting on signal %d\n", signo);
(void)sprintf(buf, "exiting on signal %d", signo);