From: millert Date: Sun, 4 May 1997 21:05:28 +0000 (+0000) Subject: Fix writing of pid file. From Matthieu Herrb X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=57349d0445e841861ffeb92ff7570f8577a09977;p=openbsd Fix writing of pid file. From Matthieu Herrb Closes OpenBSD PR#178 --- 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);