From: Martin Schwenke Date: Tue, 6 Nov 2018 03:06:14 +0000 (+1100) Subject: ctdb-daemon: Switch interactive variable to a bool X-Git-Tag: tdb-1.3.17~869 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01f6fbba4e5823f2cc028ba6f094b55812dff6ee;p=thirdparty%2Fsamba.git ctdb-daemon: Switch interactive variable to a bool popt uses an int in place of a bool, so declare an extra int and make the conversion explicit. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index 7cfd30b1a8c..ebe111ddde6 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -152,11 +152,12 @@ static struct ctdb_context *ctdb_init(struct tevent_context *ev) int main(int argc, const char *argv[]) { struct ctdb_context *ctdb = NULL; - int interactive = 0; + int interactive_opt = 0; + bool interactive = false; struct poptOption popt_options[] = { POPT_AUTOHELP - { "interactive", 'i', POPT_ARG_NONE, &interactive, 0, + { "interactive", 'i', POPT_ARG_NONE, &interactive_opt, 0, "don't fork, log to stderr", NULL }, POPT_TABLEEND }; @@ -224,6 +225,8 @@ int main(int argc, const char *argv[]) } } + interactive = (interactive_opt != 0); + /* * Configuration file handling */ @@ -372,7 +375,7 @@ int main(int argc, const char *argv[]) } /* start the protocol running (as a child) */ - return ctdb_start_daemon(ctdb, interactive?false:true); + return ctdb_start_daemon(ctdb, !interactive); fail: talloc_free(ctdb);