From 47d61ca8db78e5976400dbe08f426c0985e6e801 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 7 Nov 2009 12:59:17 -0500 Subject: Fix tevent_req error checking. When possible using a macro that correctly deals with tstate --- server/db/sysdb.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'server/db/sysdb.c') diff --git a/server/db/sysdb.c b/server/db/sysdb.c index 971add09..e4131f11 100644 --- a/server/db/sysdb.c +++ b/server/db/sysdb.c @@ -375,12 +375,8 @@ static int sysdb_get_handle_recv(struct tevent_req *req, TALLOC_CTX *memctx, { struct sysdb_get_handle_state *state = tevent_req_data(req, struct sysdb_get_handle_state); - enum tevent_req_state tstate; - uint64_t err; - if (tevent_req_is_error(req, &tstate, &err)) { - return err; - } + TEVENT_REQ_RETURN_ON_ERROR(req); *handle = talloc_steal(memctx, state->handle); if (!*handle) return ENOMEM; @@ -454,12 +450,8 @@ int sysdb_transaction_recv(struct tevent_req *req, TALLOC_CTX *memctx, { struct sysdb_transaction_state *state = tevent_req_data(req, struct sysdb_transaction_state); - enum tevent_req_state tstate; - uint64_t err; - if (tevent_req_is_error(req, &tstate, &err)) { - return err; - } + TEVENT_REQ_RETURN_ON_ERROR(req); *handle = talloc_steal(memctx, state->handle); if (!*handle) return ENOMEM; @@ -503,16 +495,12 @@ int sysdb_transaction_commit_recv(struct tevent_req *req) { struct sysdb_transaction_state *state = tevent_req_data(req, struct sysdb_transaction_state); - enum tevent_req_state tstate; - uint64_t err; /* finally free handle * this will also trigger the next transaction in the queue if any */ talloc_zfree(state->handle); - if (tevent_req_is_error(req, &tstate, &err)) { - return err; - } + TEVENT_REQ_RETURN_ON_ERROR(req); return EOK; } @@ -595,12 +583,8 @@ int sysdb_operation_recv(struct tevent_req *req, TALLOC_CTX *memctx, { struct sysdb_operation_state *state = tevent_req_data(req, struct sysdb_operation_state); - enum tevent_req_state tstate; - uint64_t err; - if (tevent_req_is_error(req, &tstate, &err)) { - return err; - } + TEVENT_REQ_RETURN_ON_ERROR(req); *handle = talloc_steal(memctx, state->handle); if (!*handle) return ENOMEM; -- cgit