From d965ff05c9923c8a0e440e905d0d9fe662cc5db0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 21 Jan 2009 09:16:45 +0100 Subject: s4:ldb: remove dependency to samba4's events wrapper metze --- source4/lib/ldb/common/ldb.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source4/lib/ldb/common/ldb.c') diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 4443362448..fe55d1499a 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -48,7 +48,7 @@ struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx) /* FIXME: Hack a new event context so that CMD line utilities work * until we have them all converted */ if (ev_ctx == NULL) { - ev_ctx = event_context_init(talloc_autofree_context()); + ev_ctx = tevent_context_init(talloc_autofree_context()); } ret = ldb_setup_wellknown_attributes(ldb); @@ -394,6 +394,7 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type) { struct tevent_context *ev; + int ret; if (!handle) { return LDB_ERR_UNAVAILABLE; @@ -410,7 +411,10 @@ int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type) switch (type) { case LDB_WAIT_NONE: - event_loop_once(ev); + ret = tevent_loop_once(ev); + if (ret != 0) { + return LDB_ERR_OPERATIONS_ERROR; + } if (handle->state == LDB_ASYNC_DONE || handle->status != LDB_SUCCESS) { return handle->status; @@ -419,7 +423,10 @@ int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type) case LDB_WAIT_ALL: while (handle->state != LDB_ASYNC_DONE) { - event_loop_once(ev); + ret = tevent_loop_once(ev); + if (ret != 0) { + return LDB_ERR_OPERATIONS_ERROR; + } if (handle->status != LDB_SUCCESS) { return handle->status; } -- cgit