summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mrouted/main.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2001-12-01 23:27:19 +0000
committermiod <miod@openbsd.org>2001-12-01 23:27:19 +0000
commitb7827e9b6854c0acfcc16f985d74f53f2b19b034 (patch)
tree55e1b4e49016953592ab3be7429d7f4c1197b2d0 /usr.sbin/mrouted/main.c
parentdon't pass user defined variables to /usr/bin/login (diff)
downloadwireguard-openbsd-b7827e9b6854c0acfcc16f985d74f53f2b19b034.tar.xz
wireguard-openbsd-b7827e9b6854c0acfcc16f985d74f53f2b19b034.zip
Use pidfile() instead of doing the equivalent thing by hand, and sometimes
forgetting to unlink the pid file at exit. ok millert@ deraadt@
Diffstat (limited to 'usr.sbin/mrouted/main.c')
-rw-r--r--usr.sbin/mrouted/main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c
index d1e2ce4be89..536518f5831 100644
--- a/usr.sbin/mrouted/main.c
+++ b/usr.sbin/mrouted/main.c
@@ -26,6 +26,7 @@
#include <varargs.h>
#endif
#include <fcntl.h>
+#include <util.h>
#ifdef SNMP
#include "snmp.h"
@@ -33,13 +34,12 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Id: main.c,v 1.6 2001/09/04 23:35:59 millert Exp $";
+ "@(#) $Id: main.c,v 1.7 2001/12/01 23:27:23 miod Exp $";
#endif
extern char *configfilename;
char versionstring[100];
-static char pidfilename[] = _PATH_MROUTED_PID;
static char dumpfilename[] = _PATH_MROUTED_DUMP;
static char cachefilename[] = _PATH_MROUTED_CACHE;
static char genidfilename[] = _PATH_MROUTED_GENID;
@@ -271,11 +271,7 @@ usage: fprintf(stderr,
if (debug)
fprintf(stderr, "pruning %s\n", pruning ? "on" : "off");
- fp = fopen(pidfilename, "w");
- if (fp != NULL) {
- fprintf(fp, "%d\n", (int)getpid());
- (void) fclose(fp);
- }
+ pidfile(NULL);
(void)signal(SIGALRM, fasttimer);