lib/util: add samba_tevent_set_debug()
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Feb 2013 08:00:56 +0000 (09:00 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 28 Feb 2013 11:11:48 +0000 (12:11 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/util/samba_util.h
lib/util/tevent_debug.c

index f59dc70f2f703c3630d941c2c8eefc84e3af1da0..6a4373e4247ade5e3d115ff7328f401460f735f2 100644 (file)
@@ -966,4 +966,12 @@ bool server_id_is_disconnected(const struct server_id *id);
  */
 struct tevent_context *samba_tevent_context_init(TALLOC_CTX *mem_ctx);
 
+/*
+ * if same samba code needs to use a specific tevent backend
+ * it can use something like this:
+ *
+ * samba_tevent_set_debug(ev, "pysmb_tevent");
+ */
+void samba_tevent_set_debug(struct tevent_context *ev, const char *name);
+
 #endif /* _SAMBA_UTIL_H_ */
index 6df58aeaf0129686876b1a694a3fcc4ff20a4aa7..3f8c649a0b6ffd99008310eb9bd4b88bddde971c 100644 (file)
@@ -65,13 +65,18 @@ static void samba_tevent_debug(void *context,
        }
 }
 
+void samba_tevent_set_debug(struct tevent_context *ev, const char *name)
+{
+       tevent_set_debug(ev, samba_tevent_debug, name);
+}
+
 struct tevent_context *samba_tevent_context_init(TALLOC_CTX *mem_ctx)
 {
        struct tevent_context *ev;
 
        ev = tevent_context_init(mem_ctx);
        if (ev) {
-               tevent_set_debug(ev, samba_tevent_debug, NULL);
+               samba_tevent_set_debug(ev, NULL);
        }
 
        return ev;