diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-02-21 09:00:56 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-02-28 12:11:48 +0100 |
commit | 6b948cf54b75ac44c4857e8da8f7db251e00b67b (patch) | |
tree | 0bb1f80dde26cb1e2325746dff8b6e8c1c18b450 /lib/util | |
parent | 6205262d38a4f7c5f97f1cb4025914ee18abd74d (diff) | |
download | samba-6b948cf54b75ac44c4857e8da8f7db251e00b67b.tar.gz samba-6b948cf54b75ac44c4857e8da8f7db251e00b67b.tar.bz2 samba-6b948cf54b75ac44c4857e8da8f7db251e00b67b.zip |
lib/util: add samba_tevent_set_debug()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/samba_util.h | 8 | ||||
-rw-r--r-- | lib/util/tevent_debug.c | 7 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index f59dc70f2f..6a4373e424 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -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_ */ diff --git a/lib/util/tevent_debug.c b/lib/util/tevent_debug.c index 6df58aeaf0..3f8c649a0b 100644 --- a/lib/util/tevent_debug.c +++ b/lib/util/tevent_debug.c @@ -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; |