diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-05-04 21:05:29 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-05-04 21:05:29 +0000 |
commit | c14e613d44447b56b35d5211f731aee707096fe6 (patch) | |
tree | f83f07befe5346d468e3b03543adacd943562784 | |
parent | 8d083e1b3991eeac6ab7edfacee140f219333911 (diff) |
Fix writing of pid file. From Matthieu Herrb <Mathieu.Herrb@mipnet.fr>
Closes OpenBSD PR#178
-rw-r--r-- | sbin/mountd/mountd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 978b7f21074..56a6e709bd1 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.15 1997/04/11 17:09:02 millert Exp $ */ +/* $OpenBSD: mountd.c,v 1.16 1997/05/04 21:05:28 millert Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -295,9 +295,11 @@ main(argc, argv) } } pidfile = freopen(_PATH_MOUNTDPID, "w", pidfile); - fprintf(pidfile, "%d\n", getpid()); - fclose(pidfile); + } else { + pidfile = fopen(_PATH_MOUNTDPID, "w"); } + fprintf(pidfile, "%d\n", getpid()); + fclose(pidfile); } signal(SIGHUP, (void (*) __P((int))) get_exportlist); signal(SIGTERM, (void (*) __P((int))) send_umntall); |