Module Name: src
Committed By: jnemeth
Date: Wed Aug 5 23:23:47 UTC 2015
Modified Files:
src/usr.sbin/mountd: mountd.c
Log Message:
PR/50125 - Jarle Greipsland -- Incorrect PID in /var/run/mountd.pid
Move call to pidfile() after daemon() so that correct (child) pid is
written to pidfile.
To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/usr.sbin/mountd/mountd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/mountd/mountd.c
diff -u src/usr.sbin/mountd/mountd.c:1.126 src/usr.sbin/mountd/mountd.c:1.127
--- src/usr.sbin/mountd/mountd.c:1.126 Fri Apr 4 12:45:59 2014
+++ src/usr.sbin/mountd/mountd.c Wed Aug 5 23:23:47 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: mountd.c,v 1.126 2014/04/04 12:45:59 gson Exp $ */
+/* $NetBSD: mountd.c,v 1.127 2015/08/05 23:23:47 jnemeth Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
#if 0
static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: mountd.c,v 1.126 2014/04/04 12:45:59 gson Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.127 2015/08/05 23:23:47 jnemeth Exp $");
#endif
#endif /* not lint */
@@ -336,7 +336,6 @@ main(int argc, char **argv)
(void)fprintf(stderr, "Here we go.\n");
(void)signal(SIGHUP, get_exportlist);
(void)signal(SIGTERM, send_umntall);
- pidfile(NULL);
rpcb_unset(RPCPROG_MNT, RPCMNT_VER1, NULL);
rpcb_unset(RPCPROG_MNT, RPCMNT_VER3, NULL);
@@ -463,6 +462,7 @@ main(int argc, char **argv)
(void)signal(SIGINT, SIG_IGN);
(void)signal(SIGQUIT, SIG_IGN);
}
+ pidfile(NULL);
svc_run();
syslog(LOG_ERR, "Mountd died");
exit(1);