summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-03-09 00:30:24 +0000
committerderaadt <deraadt@openbsd.org>2003-03-09 00:30:24 +0000
commitd6a1e7dc450b68d8539b83ce57f937ddc3aa5335 (patch)
tree40f85946439a8fe746abb0b326d4ac5b29fbc5cf
parentMove WANT_LIBMILTER bits until after bsd.own.mk has been pulled in. (diff)
downloadwireguard-openbsd-d6a1e7dc450b68d8539b83ce57f937ddc3aa5335.tar.xz
wireguard-openbsd-d6a1e7dc450b68d8539b83ce57f937ddc3aa5335.zip
if fopen fails, do not bork; rob@animoid-row.org
-rw-r--r--sbin/mountd/mountd.c8
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);