aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/inetd/inetd.c
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1995-10-12 16:43:27 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1995-10-12 16:43:27 +0000
commit9fe96cbb6dece349f131754d4b01092a698a9e5a (patch)
tree1048b4b14813ca8c6c2950ec8c436b07d06093a6 /usr.sbin/inetd/inetd.c
parent234d1b32a874e844b75d336f3f7227c579039d62 (diff)
downloadsrc-9fe96cbb6dece349f131754d4b01092a698a9e5a.tar.gz
src-9fe96cbb6dece349f131754d4b01092a698a9e5a.zip
Record PID in /var/run/inetd.pid and document same.
Notes
Notes: svn path=/head/; revision=11447
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-rw-r--r--usr.sbin/inetd/inetd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 3d921f25bccb..ca2fc39344ed 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
/* from: @(#)inetd.c 8.4 (Berkeley) 4/13/94"; */
static char inetd_c_rcsid[] =
- "$Id: inetd.c,v 1.5.2.1 1995/06/05 01:01:19 davidg Exp $";
+ "$Id: inetd.c,v 1.6 1995/06/11 19:32:39 rgrimes Exp $";
#endif /* not lint */
/*
@@ -296,7 +296,16 @@ main(argc, argv, envp)
if (argc > 0)
CONFIG = argv[0];
if (debug == 0) {
+ FILE *fp;
daemon(0, 0);
+ pid = getpid();
+ fp = fopen(_PATH_INETDPID, "w");
+ if (fp) {
+ fprintf(fp, "%ld\n", (long)pid);
+ fclose(fp);
+ } else {
+ syslog(LOG_WARNING, _PATH_INETDPID ": %m");
+ }
}
memset(&sv, 0, sizeof(sv));
sv.sv_mask = SIGBLOCK;