summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tevent/tevent.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c
index 669b778eb5..aa758de640 100644
--- a/lib/tevent/tevent.c
+++ b/lib/tevent/tevent.c
@@ -273,23 +273,14 @@ struct tevent_context *tevent_context_init_ops(TALLOC_CTX *mem_ctx,
struct tevent_context *tevent_context_init_byname(TALLOC_CTX *mem_ctx,
const char *name)
{
- struct tevent_ops_list *e;
-
- tevent_backend_init();
+ struct tevent_ops *ops;
- if (name == NULL) {
- name = tevent_default_backend;
- }
- if (name == NULL) {
- name = "standard";
+ ops = tevent_find_ops_byname(name);
+ if (ops == NULL) {
+ return NULL;
}
- for (e=tevent_backends;e;e=e->next) {
- if (strcmp(name, e->name) == 0) {
- return tevent_context_init_ops(mem_ctx, e->ops, NULL);
- }
- }
- return NULL;
+ return tevent_context_init_ops(mem_ctx, ops, NULL);
}