Postpone initial setting of the alarm timer until after the call to daemon(),
as the timer would be cleared by daemon's fork().
This commit is contained in:
parent
750ce43a65
commit
3114eb2be3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: syslogd.c,v 1.67 2004/10/10 09:43:02 wiz Exp $ */
|
||||
/* $NetBSD: syslogd.c,v 1.68 2004/10/28 20:04:24 heas Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1988, 1993, 1994
|
||||
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993, 1994\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: syslogd.c,v 1.67 2004/10/10 09:43:02 wiz Exp $");
|
||||
__RCSID("$NetBSD: syslogd.c,v 1.68 2004/10/28 20:04:24 heas Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -377,7 +377,6 @@ getgroup:
|
||||
(void)signal(SIGQUIT, Debug ? die : SIG_IGN);
|
||||
(void)signal(SIGCHLD, reapchild);
|
||||
(void)signal(SIGALRM, domark);
|
||||
(void)alarm(TIMERINTVL);
|
||||
|
||||
#ifndef SUN_LEN
|
||||
#define SUN_LEN(unp) (strlen((unp)->sun_path) + 2)
|
||||
@ -478,6 +477,9 @@ getgroup:
|
||||
pidfile(NULL);
|
||||
}
|
||||
|
||||
/* set timer for mark facility after the fork of daemon() */
|
||||
(void)alarm(TIMERINTVL);
|
||||
|
||||
for (;;) {
|
||||
int rv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user