summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-11-20 09:44:01 -0500
committerSimo Sorce <idra@samba.org>2008-11-20 09:44:01 -0500
commit578a8c810800fc90b7485b79b01a13aec7eda19a (patch)
tree4495a7a4d0c37bb3ee7f4598aca2458f0ce7c705 /server/providers
parentf2b8565202a28a4a3c28e3c0fb4bbb7515a4d7b0 (diff)
downloadsssd-578a8c810800fc90b7485b79b01a13aec7eda19a.tar.gz
sssd-578a8c810800fc90b7485b79b01a13aec7eda19a.tar.bz2
sssd-578a8c810800fc90b7485b79b01a13aec7eda19a.zip
Remove unused code and fix message handlers in dp
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/data_provider.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index df9cfdf6..565581a8 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -86,8 +86,6 @@ static int reply_ping(DBusMessage *message, void *data, DBusMessage **r)
static int dp_monitor_init(struct dp_ctx *dpctx)
{
- struct sbus_method_ctx *cli_sm_ctx;
- struct sbus_method_ctx *srv_sm_ctx;
struct dp_sbus_ctx *sbus_ctx;
DBusConnection *dbus_conn;
char *sbus_address;
@@ -114,36 +112,24 @@ static int dp_monitor_init(struct dp_ctx *dpctx)
return ret;
}
dbus_conn = sbus_get_connection(sbus_ctx->scon_ctx);
- dbus_connection_set_exit_on_disconnect(dbus_conn, TRUE);
/* set up handler for service methods */
- srv_sm_ctx = talloc_zero(sbus_ctx, struct sbus_method_ctx);
- if (!srv_sm_ctx) {
+ sbus_ctx->sm_ctx = talloc_zero(sbus_ctx, struct sbus_method_ctx);
+ if (!sbus_ctx->sm_ctx) {
talloc_free(sbus_ctx);
return ENOMEM;
}
- srv_sm_ctx->interface = talloc_strdup(srv_sm_ctx, SERVICE_INTERFACE);
- srv_sm_ctx->path = talloc_strdup(srv_sm_ctx, SERVICE_PATH);
- if (!srv_sm_ctx->interface || !srv_sm_ctx->path) {
+ sbus_ctx->sm_ctx->interface = talloc_strdup(sbus_ctx->sm_ctx,
+ SERVICE_INTERFACE);
+ sbus_ctx->sm_ctx->path = talloc_strdup(sbus_ctx->sm_ctx,
+ SERVICE_PATH);
+ if (!sbus_ctx->sm_ctx->interface || !sbus_ctx->sm_ctx->path) {
talloc_free(sbus_ctx);
return ENOMEM;
}
- srv_sm_ctx->methods = mon_sbus_methods;
- sbus_conn_add_method_ctx(sbus_ctx->scon_ctx, srv_sm_ctx);
-
- /* set up client stuff */
- cli_sm_ctx = talloc(sbus_ctx, struct sbus_method_ctx);
- if (!cli_sm_ctx) {
- talloc_free(sbus_ctx);
- return ENOMEM;
- }
- cli_sm_ctx->interface = talloc_strdup(cli_sm_ctx, MONITOR_DBUS_INTERFACE);
- cli_sm_ctx->path = talloc_strdup(cli_sm_ctx, MONITOR_DBUS_PATH);
- if (!cli_sm_ctx->interface || !cli_sm_ctx->path) {
- talloc_free(sbus_ctx);
- return ENOMEM;
- }
- sbus_ctx->sm_ctx = cli_sm_ctx;
+ sbus_ctx->sm_ctx->methods = mon_sbus_methods;
+ sbus_ctx->sm_ctx->message_handler = sbus_message_handler;
+ sbus_conn_add_method_ctx(sbus_ctx->scon_ctx, sbus_ctx->sm_ctx);
dpctx->sbus_ctx = sbus_ctx;