summaryrefslogtreecommitdiff
path: root/lib/util/tevent_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/tevent_debug.c')
-rw-r--r--lib/util/tevent_debug.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/util/tevent_debug.c b/lib/util/tevent_debug.c
index 48f65299c5d..bc3dd0ca944 100644
--- a/lib/util/tevent_debug.c
+++ b/lib/util/tevent_debug.c
@@ -68,9 +68,25 @@ static void samba_tevent_debug(void *context,
}
}
+static void samba_tevent_abort_fn(const char *reason)
+{
+ smb_panic(reason);
+}
+
+static void samba_tevent_setup_abort_fn(void)
+{
+ static bool abort_fn_done;
+
+ if (!abort_fn_done) {
+ tevent_set_abort_fn(samba_tevent_abort_fn);
+ abort_fn_done = true;
+ }
+}
+
void samba_tevent_set_debug(struct tevent_context *ev, const char *name)
{
void *p = discard_const(name);
+ samba_tevent_setup_abort_fn();
tevent_set_debug(ev, samba_tevent_debug, p);
}
@@ -78,6 +94,8 @@ struct tevent_context *samba_tevent_context_init(TALLOC_CTX *mem_ctx)
{
struct tevent_context *ev;
+ samba_tevent_setup_abort_fn();
+
ev = tevent_context_init(mem_ctx);
if (ev) {
samba_tevent_set_debug(ev, NULL);