diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-11-07 12:59:17 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-11-09 13:50:30 -0500 |
commit | 47d61ca8db78e5976400dbe08f426c0985e6e801 (patch) | |
tree | ec74b9a683113660420ee0aca8f10122ea8eb475 /server/db/sysdb.c | |
parent | 35d0b225578e179b8c21f1eee59fcf075eb1f692 (diff) | |
download | sssd-47d61ca8db78e5976400dbe08f426c0985e6e801.tar.gz sssd-47d61ca8db78e5976400dbe08f426c0985e6e801.tar.bz2 sssd-47d61ca8db78e5976400dbe08f426c0985e6e801.zip |
Fix tevent_req error checking.
When possible using a macro that correctly deals with tstate
Diffstat (limited to 'server/db/sysdb.c')
-rw-r--r-- | server/db/sysdb.c | 24 |
1 files changed, 4 insertions, 20 deletions
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; |