summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-08-06 08:55:27 +0200
committerStephen Gallagher <sgallagh@redhat.com>2009-10-22 13:56:21 -0400
commit6a2b3bd9e61336ca12cc7dbb8f2a54c5f53b1f34 (patch)
tree054387b6ac52725a9115d7de8fe8b63456df9c36
parente668febd6ca1efdb1ec3ce1be2c5236a65b6c103 (diff)
downloadsssd-6a2b3bd9e61336ca12cc7dbb8f2a54c5f53b1f34.tar.gz
sssd-6a2b3bd9e61336ca12cc7dbb8f2a54c5f53b1f34.tar.bz2
sssd-6a2b3bd9e61336ca12cc7dbb8f2a54c5f53b1f34.zip
Resolver: Use talloc_get_type() for type safety
-rw-r--r--server/resolv/async_resolv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/resolv/async_resolv.c b/server/resolv/async_resolv.c
index c269f3ec..396a4e19 100644
--- a/server/resolv/async_resolv.c
+++ b/server/resolv/async_resolv.c
@@ -101,7 +101,7 @@ static void
fd_input_available(struct tevent_context *ev, struct tevent_fd *fde,
uint16_t flags, void *data)
{
- struct fd_watch *watch = data;
+ struct fd_watch *watch = talloc_get_type(data, struct fd_watch);
if (watch->ctx->channel == NULL) {
DEBUG(1, ("Invalid ares channel - this is likely a bug\n"));
@@ -124,7 +124,7 @@ static void fd_event_close(struct resolv_ctx *ctx, int s);
static void
fd_event(void *data, int s, int fd_read, int fd_write)
{
- struct resolv_ctx *ctx = data;
+ struct resolv_ctx *ctx = talloc_get_type(data, struct resolv_ctx);
struct fd_watch *watch;
/* The socket is about to get closed. */
@@ -315,7 +315,7 @@ resolv_gethostbyname_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
static void
resolv_gethostbyname_done(void *arg, int status, int timeouts, struct hostent *hostent)
{
- struct tevent_req *req = arg;
+ struct tevent_req *req = talloc_get_type(arg, struct tevent_req);
struct gethostbyname_state *state = tevent_req_data(req, struct gethostbyname_state);
state->hostent = hostent;
@@ -432,7 +432,7 @@ resolv_getsrv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
static void
resolv_getsrv_done(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
{
- struct tevent_req *req = arg;
+ struct tevent_req *req = talloc_get_type(arg, struct tevent_req);
struct getsrv_state *state = tevent_req_data(req, struct getsrv_state);
int ret;
int num_replies;
@@ -562,7 +562,7 @@ resolv_gettxt_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
static void
resolv_gettxt_done(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
{
- struct tevent_req *req = arg;
+ struct tevent_req *req = talloc_get_type(arg, struct tevent_req);
struct gettxt_state *state = tevent_req_data(req, struct gettxt_state);
int ret;
int num_replies;