From: Martin Schwenke Date: Mon, 21 Mar 2016 00:42:40 +0000 (+1100) Subject: ctdb-killtcp: Set debug level via environment variable CTDB_DEBUGLEVEL X-Git-Tag: tdb-1.3.9~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb2fee2c43ba1875a2075b952fb625784e03e346;p=thirdparty%2Fsamba.git ctdb-killtcp: Set debug level via environment variable CTDB_DEBUGLEVEL Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tools/ctdb_killtcp.c b/ctdb/tools/ctdb_killtcp.c index 0188b8b2ee4..27b3e89eb34 100644 --- a/ctdb/tools/ctdb_killtcp.c +++ b/ctdb/tools/ctdb_killtcp.c @@ -315,10 +315,20 @@ int main(int argc, char **argv) struct tevent_context *ev = NULL; struct TALLOC_CONTEXT *mem_ctx = NULL; struct ctdb_connection *conns = NULL; + const char *t; + enum debug_level debug_level; bool done; int num = 0; int i, ret; + /* Set the debug level */ + t = getenv("CTDB_DEBUGLEVEL"); + if (t != NULL) { + if (debug_level_parse(t, &debug_level)) { + DEBUGLEVEL = debug_level_to_int(debug_level); + } + } + prog = argv[0]; if (argc != 2 && argc != 4) {