Source-Changes-HG archive

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

[src/netbsd-3]: src/usr.sbin/rpc.statd Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/8d563adbf1cc
branches:  netbsd-3
changeset: 577910:8d563adbf1cc
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Mar 29 14:47:32 2006 +0000

description:
Pull up following revision(s) (requested by tron in ticket #1228):
        usr.sbin/rpc.statd/statd.c: revision 1.27
Use sigaction(2) to setup automatic disposal of child processes after
daemonizing. This is more portable and avoids zombie "rpc.statd"
processes after an NFS client running e.g. Mac OS X shuts down.
Reviewed by christos@.

diffstat:

 usr.sbin/rpc.statd/statd.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 87796a49dd9f -r 8d563adbf1cc usr.sbin/rpc.statd/statd.c
--- a/usr.sbin/rpc.statd/statd.c        Tue Mar 28 23:03:06 2006 +0000
+++ b/usr.sbin/rpc.statd/statd.c        Wed Mar 29 14:47:32 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: statd.c,v 1.23.6.2 2005/11/27 22:55:29 riz Exp $       */
+/*     $NetBSD: statd.c,v 1.23.6.3 2006/03/29 14:47:32 riz Exp $       */
 
 /*
  * Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: statd.c,v 1.23.6.2 2005/11/27 22:55:29 riz Exp $");
+__RCSID("$NetBSD: statd.c,v 1.23.6.3 2006/03/29 14:47:32 riz Exp $");
 #endif
 
 /* main() function for status monitor daemon.  Some of the code in this        */
@@ -101,11 +101,6 @@
        struct sigaction nsa;
        int maxrec = RPC_MAXDATASIZE;
 
-       sigemptyset(&nsa.sa_mask);
-       nsa.sa_flags = SA_NOCLDSTOP|SA_NOCLDWAIT;
-       nsa.sa_handler = SIG_IGN;
-       (void)sigaction(SIGCHLD, &nsa, NULL);
-
        while ((ch = getopt(argc, argv, "d")) != (-1)) {
                switch (ch) {
                case 'd':
@@ -140,6 +135,12 @@
         */
        if (!debug)
                daemon(0, 0);
+
+       sigemptyset(&nsa.sa_mask);
+       nsa.sa_flags = SA_NOCLDSTOP|SA_NOCLDWAIT;
+       nsa.sa_handler = SIG_IGN;
+       (void)sigaction(SIGCHLD, &nsa, NULL);
+
        pidfile(NULL);
        openlog("rpc.statd", 0, LOG_DAEMON);
        if (debug)



Home | Main Index | Thread Index | Old Index