Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mountd When daemonizing, delay the parent exit unti...



details:   https://anonhg.NetBSD.org/src/rev/c1f320537de8
branches:  trunk
changeset: 328482:c1f320537de8
user:      gson <gson%NetBSD.org@localhost>
date:      Fri Apr 04 12:45:59 2014 +0000

description:
When daemonizing, delay the parent exit until the daemon is ready to
provide service.  Fixes a race that is a third possible cause of
PR misc/48282, in addition to the ones in rpc.rquotad and nfsd that
were fixed earlier.

diffstat:

 usr.sbin/mountd/mountd.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 8a332394912c -r c1f320537de8 usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c  Fri Apr 04 12:25:45 2014 +0000
+++ b/usr.sbin/mountd/mountd.c  Fri Apr 04 12:45:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.c,v 1.125 2013/10/19 17:16:37 christos Exp $     */
+/*     $NetBSD: mountd.c,v 1.126 2014/04/04 12:45:59 gson Exp $         */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.125 2013/10/19 17:16:37 christos Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.126 2014/04/04 12:45:59 gson Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -334,11 +334,6 @@
        get_mountlist();
        if (debug)
                (void)fprintf(stderr, "Here we go.\n");
-       if (debug == 0) {
-               daemon(0, 0);
-               (void)signal(SIGINT, SIG_IGN);
-               (void)signal(SIGQUIT, SIG_IGN);
-       }
        (void)signal(SIGHUP, get_exportlist);
        (void)signal(SIGTERM, send_umntall);
        pidfile(NULL);
@@ -463,6 +458,11 @@
                exit(1);
        }
 
+       if (debug == 0) {
+               daemon(0, 0);
+               (void)signal(SIGINT, SIG_IGN);
+               (void)signal(SIGQUIT, SIG_IGN);
+       }
        svc_run();
        syslog(LOG_ERR, "Mountd died");
        exit(1);



Home | Main Index | Thread Index | Old Index