diff options
author | Greg Hudson <ghudson@mit.edu> | 1994-10-31 09:50:52 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 1994-10-31 09:50:52 +0000 |
commit | e3e38baad98fff95073f2063b7502bcd412bbfdc (patch) | |
tree | f5bd5e784f56cd2da7e9f99502d88f4225d07e11 /zhm | |
parent | 50ef9dda28e338e2ef27e47ed01b86833bd378ae (diff) |
Add nofork option (-n).
Diffstat (limited to 'zhm')
-rw-r--r-- | zhm/zhm.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 */ |