From 9259569fd8b2898589422e4c7a8f21846d61f1da Mon Sep 17 00:00:00 2001 From: "Liam J. Foy" Date: Fri, 27 May 2005 11:24:49 +0000 Subject: [PATCH] - Use pidfile(3). The pid file can be used as a quick reference if the process needs to be sent a signal. Obtained from: NetBSD --- usr.sbin/rwhod/Makefile | 5 ++++- usr.sbin/rwhod/rwhod.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rwhod/Makefile b/usr.sbin/rwhod/Makefile index e31ee88a89..98dfb421a5 100644 --- a/usr.sbin/rwhod/Makefile +++ b/usr.sbin/rwhod/Makefile @@ -1,9 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD: src/usr.sbin/rwhod/Makefile,v 1.2.14.1 2001/04/25 12:10:49 ru Exp $ -# $DragonFly: src/usr.sbin/rwhod/Makefile,v 1.3 2005/03/17 15:39:34 joerg Exp $ +# $DragonFly: src/usr.sbin/rwhod/Makefile,v 1.4 2005/05/27 11:24:49 liamfoy Exp $ PROG= rwhod MAN= rwhod.8 WARNS?= 6 +LDADD+= -lutil +DPADD+= ${LIBUTIL} + .include diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 373369d744..634b7f959f 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)rwhod.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.sbin/rwhod/rwhod.c,v 1.13.2.2 2000/12/23 15:28:12 iedowse Exp $ - * $DragonFly: src/usr.sbin/rwhod/rwhod.c,v 1.17 2005/05/22 17:09:53 liamfoy Exp $ + * $DragonFly: src/usr.sbin/rwhod/rwhod.c,v 1.18 2005/05/27 11:24:49 liamfoy Exp $ */ #include @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -212,6 +213,7 @@ main(int argc, char *argv[]) usage(); #ifndef DEBUG daemon(1, 0); + pidfile(getprogname()); #endif signal(SIGHUP, onsignal); openlog("rwhod", LOG_PID, LOG_DAEMON); -- 2.41.0