summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-14 09:30:31 +0100
committerJeremy Allison <jra@samba.org>2013-02-14 10:19:38 -0800
commit5fe459f5d7c0e6b5eeeb1aa2c8248e174a31008f (patch)
treeb03203019a402b10bdc66c38ddaf1a85b4452ea5 /lib
parentb5556a79e39be0bc9945cbac4e603b045ab55505 (diff)
downloadsamba-5fe459f5d7c0e6b5eeeb1aa2c8248e174a31008f.tar.gz
samba-5fe459f5d7c0e6b5eeeb1aa2c8248e174a31008f.tar.bz2
samba-5fe459f5d7c0e6b5eeeb1aa2c8248e174a31008f.zip
tevent: make use of tevent_find_ops_byname() in tevent_context_init_byname()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-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);
}