summaryrefslogtreecommitdiff
path: root/server/resolv
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-11-07 12:59:17 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-11-09 13:50:30 -0500
commit47d61ca8db78e5976400dbe08f426c0985e6e801 (patch)
treeec74b9a683113660420ee0aca8f10122ea8eb475 /server/resolv
parent35d0b225578e179b8c21f1eee59fcf075eb1f692 (diff)
downloadsssd-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/resolv')
-rw-r--r--server/resolv/async_resolv.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/server/resolv/async_resolv.c b/server/resolv/async_resolv.c
index f6ed2028..c05461d6 100644
--- a/server/resolv/async_resolv.c
+++ b/server/resolv/async_resolv.c
@@ -400,8 +400,6 @@ resolv_gethostbyname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct hostent **hostent)
{
struct gethostbyname_state *state = tevent_req_data(req, struct gethostbyname_state);
- enum tevent_req_state tstate;
- uint64_t err = EIO;
/* Fill in even in case of error as status contains the
* c-ares return code */
@@ -415,9 +413,7 @@ resolv_gethostbyname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
*hostent = talloc_steal(mem_ctx, state->hostent);
}
- if (tevent_req_is_error(req, &tstate, &err)) {
- return err;
- }
+ TEVENT_REQ_RETURN_ON_ERROR(req);
return EOK;
}
@@ -587,8 +583,6 @@ resolv_getsrv_recv(TALLOC_CTX *mem_ctx, struct tevent_req *req, int *status,
int *num_replies)
{
struct getsrv_state *state = tevent_req_data(req, struct getsrv_state);
- enum tevent_req_state tstate;
- uint64_t err;
if (status)
*status = state->status;
@@ -599,8 +593,7 @@ resolv_getsrv_recv(TALLOC_CTX *mem_ctx, struct tevent_req *req, int *status,
if (num_replies)
*num_replies = state->num_replies;
- if (tevent_req_is_error(req, &tstate, &err))
- return -1;
+ TEVENT_REQ_RETURN_ON_ERROR(req);
return EOK;
}
@@ -769,8 +762,6 @@ resolv_gettxt_recv(TALLOC_CTX *mem_ctx, struct tevent_req *req, int *status,
int *num_replies)
{
struct gettxt_state *state = tevent_req_data(req, struct gettxt_state);
- enum tevent_req_state tstate;
- uint64_t err;
if (status)
*status = state->status;
@@ -781,8 +772,7 @@ resolv_gettxt_recv(TALLOC_CTX *mem_ctx, struct tevent_req *req, int *status,
if (num_replies)
*num_replies = state->num_replies;
- if (tevent_req_is_error(req, &tstate, &err))
- return -1;
+ TEVENT_REQ_RETURN_ON_ERROR(req);
return EOK;
}