summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-19 11:38:36 -0700
committerJeremy Allison <jra@samba.org>2007-10-19 11:38:36 -0700
commit9a85533914119fb995fb61555c9f6e0018d4d181 (patch)
tree61bd1af2845f9fa2eb7632c1173d382131772798 /source3/winbindd
parent61e482cfdfec09ed01225320ba6a4acd47081f63 (diff)
downloadsamba-9a85533914119fb995fb61555c9f6e0018d4d181.tar.gz
samba-9a85533914119fb995fb61555c9f6e0018d4d181.tar.bz2
samba-9a85533914119fb995fb61555c9f6e0018d4d181.zip
Fix the popt / bool issues. Some places we used BOOL
where we meant int. Fix this. Thanks to metze for pointing this out. Jeremy. (This used to be commit 793a9d24a163cb6cf5a3a0aa5ae30e9f8cf4744a)
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index d5f24d7aa2..8449795e13 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -984,18 +984,24 @@ static void process_loop(void)
int main(int argc, char **argv, char **envp)
{
pstring logfile;
- static int is_daemon = False;
- static int Fork = True;
- static int log_stdout = False;
- static int no_process_group = False;
+ static bool is_daemon = False;
+ static bool Fork = True;
+ static bool log_stdout = False;
+ static bool no_process_group = False;
+ enum {
+ OPT_DAEMON = 1000,
+ OPT_FORK,
+ OPT_NO_PROCESS_GROUP,
+ OPT_LOG_STDOUT
+ };
struct poptOption long_options[] = {
POPT_AUTOHELP
- { "stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
- { "foreground", 'F', POPT_ARG_VAL, &Fork, False, "Daemon in foreground mode" },
- { "no-process-group", 0, POPT_ARG_VAL, &no_process_group, True, "Don't create a new process group" },
- { "daemon", 'D', POPT_ARG_NONE, NULL, 'D', "Become a daemon (default)" },
+ { "stdout", 'S', POPT_ARG_NONE, NULL, OPT_LOG_STDOUT, "Log to stdout" },
+ { "foreground", 'F', POPT_ARG_NONE, NULL, OPT_FORK, "Daemon in foreground mode" },
+ { "no-process-group", 0, POPT_ARG_NONE, NULL, OPT_NO_PROCESS_GROUP, "Don't create a new process group" },
+ { "daemon", 'D', POPT_ARG_NONE, NULL, OPT_DAEMON, "Become a daemon (default)" },
{ "interactive", 'i', POPT_ARG_NONE, NULL, 'i', "Interactive mode" },
- { "no-caching", 'n', POPT_ARG_VAL, &opt_nocache, True, "Disable caching" },
+ { "no-caching", 'n', POPT_ARG_NONE, NULL, 'n', "Disable caching" },
POPT_COMMON_SAMBA
POPT_TABLEEND
};
@@ -1034,7 +1040,7 @@ int main(int argc, char **argv, char **envp)
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
/* Don't become a daemon */
- case 'D':
+ case OPT_DAEMON:
is_daemon = True;
break;
case 'i':
@@ -1042,6 +1048,18 @@ int main(int argc, char **argv, char **envp)
log_stdout = True;
Fork = False;
break;
+ case OPT_FORK:
+ Fork = false;
+ break;
+ case OPT_NO_PROCESS_GROUP:
+ no_process_group = true;
+ break;
+ case OPT_LOG_STDOUT:
+ log_stdout = true;
+ break;
+ case 'n':
+ opt_nocache = true;
+ break;
default:
d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));