diff options
author | Jeremy Allison <jra@samba.org> | 2009-03-18 20:02:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-03-18 20:02:26 -0700 |
commit | add8163c3b301ff153e7b492265fc2dc72784c7e (patch) | |
tree | e97dadf4f71e1f6e3c33cfba9c61f9ed5b304dc9 /lib/tevent/tevent.c | |
parent | a00a9e4e2cc30338b4b44109e384f16f5df76f0b (diff) | |
parent | d380c49791d1010d759369cab12d93b6fbd48dc7 (diff) | |
download | samba-add8163c3b301ff153e7b492265fc2dc72784c7e.tar.gz samba-add8163c3b301ff153e7b492265fc2dc72784c7e.tar.bz2 samba-add8163c3b301ff153e7b492265fc2dc72784c7e.zip |
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'lib/tevent/tevent.c')
-rw-r--r-- | lib/tevent/tevent.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c index ba2d93f4b9..56fd6aec7a 100644 --- a/lib/tevent/tevent.c +++ b/lib/tevent/tevent.c @@ -427,6 +427,14 @@ void tevent_loop_set_nesting_hook(struct tevent_context *ev, tevent_nesting_hook hook, void *private_data) { + if (ev->nesting.hook_fn && + (ev->nesting.hook_fn != hook || + ev->nesting.hook_private != private_data)) { + /* the way the nesting hook code is currently written + we cannot support two different nesting hooks at the + same time. */ + tevent_abort(ev, "tevent: Violation of nesting hook rules\n"); + } ev->nesting.hook_fn = hook; ev->nesting.hook_private = private_data; } @@ -593,5 +601,9 @@ int tevent_common_loop_wait(struct tevent_context *ev, */ int _tevent_loop_wait(struct tevent_context *ev, const char *location) { - return ev->ops->loop_wait(ev, location); + int ret; + ev->nesting.level++; + ret = ev->ops->loop_wait(ev, location); + ev->nesting.level--; + return ret; } |