diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c index 1b7450527390..24d3c8575a20 100644 --- a/usr.sbin/rpc.statd/statd.c +++ b/usr.sbin/rpc.statd/statd.c @@ -1,4 +1,4 @@ -/* $NetBSD: statd.c,v 1.26 2006/03/17 02:41:31 elad Exp $ */ +/* $NetBSD: statd.c,v 1.27 2006/03/28 15:21:00 tron Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: statd.c,v 1.26 2006/03/17 02:41:31 elad Exp $"); +__RCSID("$NetBSD: statd.c,v 1.27 2006/03/28 15:21:00 tron Exp $"); #endif /* main() function for status monitor daemon. Some of the code in this */ @@ -101,11 +101,6 @@ main(argc, argv) 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 @@ main(argc, argv) */ 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)