summaryrefslogtreecommitdiffstats
path: root/server/responder/common/responder_common.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-07-31 09:52:14 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-10 09:42:18 -0400
commit2b0f40eaba44742fa38bb5b67ada510e7b2b6324 (patch)
tree10317ab1e5428020e0363c45a3e943141a14e519 /server/responder/common/responder_common.c
parent508b5b2a360c9530c6ea67a7b7ed6d61559846e4 (diff)
downloadsssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.tar.gz
sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.tar.xz
sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.zip
Remove redundant memory contexts
Simplify code by removing stuff that is never used or redundant.
Diffstat (limited to 'server/responder/common/responder_common.c')
-rw-r--r--server/responder/common/responder_common.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/server/responder/common/responder_common.c b/server/responder/common/responder_common.c
index 825d77e71..f8744b676 100644
--- a/server/responder/common/responder_common.c
+++ b/server/responder/common/responder_common.c
@@ -287,10 +287,8 @@ static void accept_fd_handler(struct tevent_context *ev,
static int sss_sbus_init(struct resp_ctx *rctx)
{
- int ret;
char *sbus_address;
- struct service_sbus_ctx *ss_ctx;
- struct sbus_method_ctx *sm_ctx;
+ int ret;
/* Set up SBUS connection to the monitor */
ret = monitor_get_sbus_address(rctx, rctx->cdb, &sbus_address);
@@ -299,17 +297,22 @@ static int sss_sbus_init(struct resp_ctx *rctx)
return ret;
}
- ret = monitor_init_sbus_methods(rctx, rctx->sss_sbus_methods, &sm_ctx);
+ ret = monitor_init_sbus_methods(rctx, rctx->sss_sbus_methods,
+ &rctx->sm_ctx);
if (ret != EOK) {
DEBUG(0, ("Could not initialize SBUS methods.\n"));
return ret;
}
- ret = sbus_client_init(rctx, rctx->ev,
- sbus_address, sm_ctx,
- NULL /* Private Data */,
- NULL /* Destructor */,
- &ss_ctx);
+ /* FIXME: remove this */
+ if (talloc_reference(rctx, rctx->sm_ctx) == NULL) {
+ DEBUG(0, ("Failed to take memory reference\n"));
+ return ENOMEM;
+ }
+
+ ret = sbus_client_init(rctx, rctx->ev, rctx->sm_ctx,
+ sbus_address, &rctx->conn_ctx,
+ NULL, NULL);
if (ret != EOK) {
DEBUG(0, ("Failed to connect to monitor services.\n"));
return ret;
@@ -318,8 +321,6 @@ static int sss_sbus_init(struct resp_ctx *rctx)
/* Set up NSS-specific listeners */
/* None currently used */
- rctx->ss_ctx = ss_ctx;
-
return EOK;
}
@@ -496,7 +497,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
DEBUG(0, ("fatal error setting up backend connector\n"));
return ret;
}
- else if (!rctx->dp_ctx) {
+ else if (!rctx->conn_ctx) {
DEBUG(0, ("Data Provider is not yet available. Retrying.\n"));
return EIO;
}