summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-08-12 11:56:28 +1000
committerAndrew Tridgell <tridge@samba.org>2011-08-12 05:18:25 +0200
commit4aba7752195ffda980abf4a98b870d113615f662 (patch)
tree950ead53a9da46b6b3c11ac5ae39431d0010aa55
parentf444eeb51c358a8062ba6e00101f88b753d69fc7 (diff)
downloadsamba-4aba7752195ffda980abf4a98b870d113615f662.tar.gz
samba-4aba7752195ffda980abf4a98b870d113615f662.tar.bz2
samba-4aba7752195ffda980abf4a98b870d113615f662.zip
tevent: don't force the nesting flag to false in the destructor
the tevent destructor is called in tevent_re_initialise(), to reset the event context back to its original state for creating child processes. We need the nesting flag to stay the same Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Fri Aug 12 05:18:25 CEST 2011 on sn-devel-104
-rw-r--r--lib/tevent/tevent.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c
index 51555bae5d..a87865b41a 100644
--- a/lib/tevent/tevent.c
+++ b/lib/tevent/tevent.c
@@ -185,9 +185,13 @@ int tevent_common_context_destructor(struct tevent_context *ev)
tevent_cleanup_pending_signal_handlers(se);
}
- /* clean up nesting or we get an abort when nesting
- * is not allowed. -- SSS */
- ev->nesting.allowed = false;
+ /* removing nesting hook or we get an abort when nesting is
+ * not allowed. -- SSS
+ * Note that we need to leave the allowed flag at its current
+ * value, otherwise the use in tevent_re_initialise() will
+ * leave the event context with allowed forced to false, which
+ * will break users that expect nesting to be allowed
+ */
ev->nesting.level = 0;
ev->nesting.hook_fn = NULL;
ev->nesting.hook_private = NULL;