diff options
author | Andreas Schneider <asn@samba.org> | 2018-11-07 14:14:05 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-11-08 11:03:11 +0100 |
commit | 2d512b278e5905964c1294c587ba405678c3d10c (patch) | |
tree | a891cf0886d58e04d3ad2faadc5545c077865929 /ctdb/tools | |
parent | 71ef09c1afdbf967b829cb66b33c3a5cb1c18ba0 (diff) | |
download | samba-2d512b278e5905964c1294c587ba405678c3d10c.tar.gz |
debug: Use debuglevel_(get|set) function
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov 8 11:03:11 CET 2018 on sn-devel-144
Diffstat (limited to 'ctdb/tools')
-rw-r--r-- | ctdb/tools/ctdb.c | 9 | ||||
-rw-r--r-- | ctdb/tools/ctdb_killtcp.c | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 8fa1ce63203..f96167f9366 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -6188,6 +6188,7 @@ int main(int argc, const char *argv[]) int extra_argc; const struct ctdb_cmd *cmd; int loglevel; + bool ok; int ret; setlinebuf(stdout); @@ -6246,11 +6247,11 @@ int main(int argc, const char *argv[]) /* Enable logging */ setup_logging("ctdb", DEBUG_STDERR); - if (debug_level_parse(options.debuglevelstr, &loglevel)) { - DEBUGLEVEL = loglevel; - } else { - DEBUGLEVEL = DEBUG_ERR; + ok = debug_level_parse(options.debuglevelstr, &loglevel); + if (!ok) { + loglevel = DEBUG_ERR; } + debuglevel_set(loglevel); signal(SIGALRM, alarm_handler); alarm(options.maxruntime); diff --git a/ctdb/tools/ctdb_killtcp.c b/ctdb/tools/ctdb_killtcp.c index 8537a579670..fc443bd08e2 100644 --- a/ctdb/tools/ctdb_killtcp.c +++ b/ctdb/tools/ctdb_killtcp.c @@ -330,16 +330,17 @@ int main(int argc, char **argv) struct tevent_req *req; int debug_level; bool status; + bool ok; int ret; /* Set the debug level */ t = getenv("CTDB_DEBUGLEVEL"); if (t != NULL) { - if (debug_level_parse(t, &debug_level)) { - DEBUGLEVEL = debug_level; - } else { - DEBUGLEVEL = DEBUG_ERR; + ok = debug_level_parse(t, &debug_level); + if (!ok) { + debug_level = DEBUG_ERR; } + debuglevel_set(debug_level); } if (argc != 2 && argc != 4) { |