]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-killtcp: Set debug level via environment variable CTDB_DEBUGLEVEL
authorMartin Schwenke <martin@meltin.net>
Mon, 21 Mar 2016 00:42:40 +0000 (11:42 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 1 Apr 2016 02:42:12 +0000 (04:42 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tools/ctdb_killtcp.c

index 0188b8b2ee42d77e9cdd251af0bcfd8a41903db4..27b3e89eb3424f92a76b468270bd3eadbf3bb04d 100644 (file)
@@ -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) {