From b3815cd84dd365f6b35e47751868fd161b2c1234 Mon Sep 17 00:00:00 2001 From: dlg Date: Sun, 12 Oct 2014 08:55:25 +0000 Subject: cut out writing a pidfile. rc.d doesnt rely on it, and nor should you. both bcook@ and schwartz@ suggested removing the pidfil unlink and path ok sthen@ schwartz@ --- usr.sbin/inetd/inetd.c | 16 +--------------- usr.sbin/inetd/pathnames.h | 3 +-- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'usr.sbin/inetd') diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 02032df2b27..e1ef826390e 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inetd.c,v 1.138 2014/06/17 03:12:37 lteo Exp $ */ +/* $OpenBSD: inetd.c,v 1.139 2014/10/12 08:55:25 dlg Exp $ */ /* * Copyright (c) 1983,1991 The Regents of the University of California. @@ -271,7 +271,6 @@ void retry(int); void doretry(void); void die(int); void dodie(void); -void logpid(void); void spawn(struct servtab *, int); int gettcp(struct servtab *); int setconfig(void); @@ -385,7 +384,6 @@ main(int argc, char *argv[]) } openlog("inetd", LOG_PID | LOG_NOWAIT, LOG_DAEMON); - logpid(); if (getrlimit(RLIMIT_NOFILE, &rlim_nofile) < 0) { syslog(LOG_ERR, "getrlimit: %m"); @@ -947,7 +945,6 @@ dodie(void) } (void)close(sep->se_fd); } - (void)unlink(_PATH_INETDPID); exit(0); } @@ -1556,17 +1553,6 @@ inetd_setproctitle(char *a, int s) setproctitle("-%s", a); } -void -logpid(void) -{ - FILE *fp; - - if ((fp = fopen(_PATH_INETDPID, "w")) != NULL) { - fprintf(fp, "%ld\n", (long)getpid()); - (void)fclose(fp); - } -} - int bump_nofile(void) { diff --git a/usr.sbin/inetd/pathnames.h b/usr.sbin/inetd/pathnames.h index 4be728c3d2b..a127f8b6823 100644 --- a/usr.sbin/inetd/pathnames.h +++ b/usr.sbin/inetd/pathnames.h @@ -27,10 +27,9 @@ * SUCH DAMAGE. * * from: @(#)pathnames.h 5.3 (Berkeley) 6/1/90 - * $Id: pathnames.h,v 1.2 2003/06/02 23:36:53 millert Exp $ + * $Id: pathnames.h,v 1.3 2014/10/12 08:55:25 dlg Exp $ */ #include #define _PATH_INETDCONF "/etc/inetd.conf" -#define _PATH_INETDPID "/var/run/inetd.pid" -- cgit v1.2.3-59-g8ed1b