summaryrefslogtreecommitdiffstats
path: root/ctdb/lib/tevent/tevent.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2012-04-26 08:09:23 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2012-04-26 08:09:23 +1000
commitdb411aaada39593c80f92e46be31d3473bf4639f (patch)
treef68222404db2155cc6d8d3f861ac486cb8a509ae /ctdb/lib/tevent/tevent.c
parent58e10b280d4a94a812bad07bbca049cddb2c1174 (diff)
parent195cf3c87e3c6c9f1784aa483110a64bc8760703 (diff)
downloadsamba-db411aaada39593c80f92e46be31d3473bf4639f.tar.gz
samba-db411aaada39593c80f92e46be31d3473bf4639f.tar.xz
samba-db411aaada39593c80f92e46be31d3473bf4639f.zip
Merge remote branch 'amitay/tevent-sync'
(This used to be ctdb commit 17ff3f240b0d72c72ed28d70fb9aeb3b20c80670)
Diffstat (limited to 'ctdb/lib/tevent/tevent.c')
-rw-r--r--ctdb/lib/tevent/tevent.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/ctdb/lib/tevent/tevent.c b/ctdb/lib/tevent/tevent.c
index 5eec5ccf56..d3421a2718 100644
--- a/ctdb/lib/tevent/tevent.c
+++ b/ctdb/lib/tevent/tevent.c
@@ -64,9 +64,6 @@
#include "tevent_internal.h"
#include "tevent_util.h"
-/* needed for the special ctdbd "track if time jumps unexpectedly */
-#include <time.h>
-
struct tevent_ops_list {
struct tevent_ops_list *next, *prev;
const char *name;
@@ -91,7 +88,7 @@ bool tevent_register_backend(const char *name, const struct tevent_ops *ops)
}
}
- e = talloc(talloc_autofree_context(), struct tevent_ops_list);
+ e = talloc(NULL, struct tevent_ops_list);
if (e == NULL) return false;
e->name = name;
@@ -107,8 +104,7 @@ bool tevent_register_backend(const char *name, const struct tevent_ops *ops)
void tevent_set_default_backend(const char *backend)
{
talloc_free(tevent_default_backend);
- tevent_default_backend = talloc_strdup(talloc_autofree_context(),
- backend);
+ tevent_default_backend = talloc_strdup(NULL, backend);
}
/*
@@ -117,6 +113,7 @@ void tevent_set_default_backend(const char *backend)
static void tevent_backend_init(void)
{
tevent_select_init();
+ tevent_poll_init();
tevent_standard_init();
#ifdef HAVE_EPOLL
tevent_epoll_init();
@@ -188,6 +185,17 @@ int tevent_common_context_destructor(struct tevent_context *ev)
tevent_cleanup_pending_signal_handlers(se);
}
+ /* 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;
+
return 0;
}
@@ -394,7 +402,6 @@ struct tevent_immediate *_tevent_create_immediate(TALLOC_CTX *mem_ctx,
/*
schedule an immediate event
- return NULL on failure
*/
void _tevent_schedule_immediate(struct tevent_immediate *im,
struct tevent_context *ev,
@@ -581,14 +588,12 @@ done:
return ret;
}
-
/*
return on failure or (with 0) if all fd events are removed
*/
int tevent_common_loop_wait(struct tevent_context *ev,
const char *location)
{
-
/*
* loop as long as we have events pending
*/