diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-04-03 14:02:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:00:12 -0500 |
commit | ed56a2c147befea36e40844d3d295fd74402b64f (patch) | |
tree | fdbe84ba9fb8d3d6fe4bc7ded45e978c3d458d0c /source4/smbd | |
parent | dd8b8dc98ae2450647f3279e744f09d0a5128945 (diff) | |
download | samba-ed56a2c147befea36e40844d3d295fd74402b64f.tar.gz samba-ed56a2c147befea36e40844d3d295fd74402b64f.tar.bz2 samba-ed56a2c147befea36e40844d3d295fd74402b64f.zip |
r14890: fix the usage of popt...
I don't know why this causes problems on my laptop today...
anyway we have done this change in smbtorture month ago...
metze
(This used to be commit ad84a69db276e3a655b2dc477214bbe0ed68411a)
Diffstat (limited to 'source4/smbd')
-rw-r--r-- | source4/smbd/server.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 8ed078863c..c496ce4b23 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -172,13 +172,17 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ NTSTATUS status; const char *model = "standard"; int max_runtime = 0; + enum { + OPT_INTERACTIVE = 1000, + OPT_PROCESS_MODEL + }; struct poptOption long_options[] = { POPT_AUTOHELP - {"interactive", 'i', POPT_ARG_VAL, &interactive, True, + {"interactive", 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE, "Run interactive (not a daemon)", NULL}, - {"model", 'M', POPT_ARG_STRING, &model, True, + {"model", 'M', POPT_ARG_STRING, NULL, OPT_PROCESS_MODEL, "Select process model", "MODEL"}, - {"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, True, + {"maximum-runtime",0, POPT_ARG_INT, &max_runtime, 0, "set maximum runtime of the server process, till autotermination", "seconds"}, POPT_COMMON_SAMBA POPT_COMMON_VERSION @@ -187,8 +191,16 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ pc = poptGetContext(binary_name, argc, argv, long_options, 0); - while((opt = poptGetNextOpt(pc)) != -1) /* noop */ ; - + while((opt = poptGetNextOpt(pc)) != -1) { + switch(opt) { + case OPT_INTERACTIVE: + interactive = True; + break; + case OPT_PROCESS_MODEL: + model = poptGetOptArg(pc); + break; + } + } poptFreeContext(pc); setup_logging(binary_name, interactive?DEBUG_STDOUT:DEBUG_FILE); |