Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/syslogd Postpone initial setting of the alarm timer...



details:   https://anonhg.NetBSD.org/src/rev/bdf2df98ae07
branches:  trunk
changeset: 570791:bdf2df98ae07
user:      heas <heas%NetBSD.org@localhost>
date:      Thu Oct 28 20:04:24 2004 +0000

description:
Postpone initial setting of the alarm timer until after the call to daemon(),
as the timer would be cleared by daemon's fork().

diffstat:

 usr.sbin/syslogd/syslogd.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 0c47ae6870f9 -r bdf2df98ae07 usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c        Thu Oct 28 19:59:09 2004 +0000
+++ b/usr.sbin/syslogd/syslogd.c        Thu Oct 28 20:04:24 2004 +0000
@@ -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 @@
 #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 @@
        (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 @@
                pidfile(NULL);
        }
 
+       /* set timer for mark facility after the fork of daemon() */
+       (void)alarm(TIMERINTVL);
+
        for (;;) {
                int rv;
 



Home | Main Index | Thread Index | Old Index