diff options
Diffstat (limited to 'sbin')
-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 b70e738af4b..74b675d7ad0 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.53 2003/01/05 22:41:36 deraadt Exp $ */ +/* $OpenBSD: mountd.c,v 1.54 2003/03/09 00:30:24 deraadt Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -283,8 +283,10 @@ main(int argc, char *argv[]) } else { pidfile = fopen(_PATH_MOUNTDPID, "w"); } - fprintf(pidfile, "%ld\n", (long)getpid()); - fclose(pidfile); + if (pidfile) { + fprintf(pidfile, "%ld\n", (long)getpid()); + fclose(pidfile); + } signal(SIGHUP, (void (*)(int)) new_exportlist); signal(SIGTERM, (void (*)(int)) send_umntall); |