diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-08-22 12:06:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:11 -0500 |
commit | 8dd00920ef8f9e6dce9bfb80c45ae46c2a562abd (patch) | |
tree | 311a8c6f0ccfdd87cfa95b00f7a8c05bbb7f63c8 /source3/smbd | |
parent | faab8dba02d364dccf341e0f6756b1bf625d3c5b (diff) | |
download | samba-8dd00920ef8f9e6dce9bfb80c45ae46c2a562abd.tar.gz samba-8dd00920ef8f9e6dce9bfb80c45ae46c2a562abd.tar.bz2 samba-8dd00920ef8f9e6dce9bfb80c45ae46c2a562abd.zip |
r24621: - deferr calling build_options();exit(0);
- use poptPrintUsage() to give the user more info
metze
(This used to be commit a95d9d1ef99d6a2f77a289f8d2011cae482821b1)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/server.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 3bb60058ac..8f6d9a38ac 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -818,6 +818,7 @@ extern void build_options(BOOL screen); const char *profile_level = NULL; int opt; poptContext pc; + BOOL print_build_options = False; enum smb_server_mode server_mode = SERVER_MODE_DAEMON; @@ -849,21 +850,25 @@ extern void build_options(BOOL screen); #endif pc = poptGetContext("smbd", argc, argv, long_options, 0); - while((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case 'b': - build_options(True); /* Display output to screen as well as debug */ - exit(0); + print_build_options = True; + break; default: - d_fprintf(stderr, "\nInvalid option %s: %s\n", + d_fprintf(stderr, "\nInvalid option %s: %s\n\n", poptBadOption(pc, 0), poptStrerror(opt)); + poptPrintUsage(pc, stderr, 0); exit(1); } } - poptFreeContext(pc); + if (print_build_options) { + build_options(True); /* Display output to screen as well as debug */ + exit(0); + } + #ifdef HAVE_SETLUID /* needed for SecureWare on SCO */ setluid(0); |