summaryrefslogtreecommitdiff
path: root/zhm
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1994-10-31 09:50:52 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1994-10-31 09:50:52 +0000
commite3e38baad98fff95073f2063b7502bcd412bbfdc (patch)
treef5bd5e784f56cd2da7e9f99502d88f4225d07e11 /zhm
parent50ef9dda28e338e2ef27e47ed01b86833bd378ae (diff)
Add nofork option (-n).
Diffstat (limited to 'zhm')
-rw-r--r--zhm/zhm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/zhm/zhm.c b/zhm/zhm.c
index 76af6b6..ff89aec 100644
--- a/zhm/zhm.c
+++ b/zhm/zhm.c
@@ -42,7 +42,7 @@ int use_hesiod = 0;
#define srandom srand48
#endif
-int hmdebug, rebootflag, errflg, dieflag, inetd, oldpid;
+int hmdebug, rebootflag, errflg, dieflag, inetd, oldpid, nofork;
int no_server = 1, nservchang, nserv, nclt;
int booting = 1, timeout_type, deactivated = 1;
long starttime;
@@ -96,7 +96,7 @@ char *argv[];
exit(-1);
}
prim_serv[0] = '\0';
- while ((opt = getopt(argc, argv, "drhi")) != EOF)
+ while ((opt = getopt(argc, argv, "drhin")) != EOF)
switch(opt) {
case 'd':
hmdebug++;
@@ -115,13 +115,16 @@ char *argv[];
inetd++;
dieflag++;
break;
+ case 'n':
+ nofork = 1;
+ break;
case '?':
default:
errflg++;
break;
}
if (errflg) {
- fprintf(stderr, "Usage: %s [-d] [-h] [-r] [server]\n", argv[0]);
+ fprintf(stderr, "Usage: %s [-d] [-h] [-r] [-n] [server]\n", argv[0]);
exit(2);
}
@@ -395,7 +398,7 @@ void init_hm()
}
#ifndef DEBUG
- if (!inetd)
+ if (!inetd && !nofork)
detach();
/* Write pid to file */