From 4e2a152169175b18f5fac45b25a8d8c8a5bea2b5 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 15 Dec 2008 15:54:08 -0500 Subject: Modified sbus_server_new() to take a talloc memory context to use as a parent for the new server context object. --- server/monitor.c | 2 +- server/providers/data_provider.c | 3 ++- server/sbus/sssd_dbus.h | 3 ++- server/sbus/sssd_dbus_server.c | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/monitor.c b/server/monitor.c index 73f993ed..c6940a83 100644 --- a/server/monitor.c +++ b/server/monitor.c @@ -157,7 +157,7 @@ static int monitor_dbus_init(struct mt_ctx *ctx) sd_ctx->methods = monitor_methods; sd_ctx->message_handler = sbus_message_handler; - ret = sbus_new_server(ctx->ev, sd_ctx, &sbus_srv, sbus_address, dbus_service_init, ctx); + ret = sbus_new_server(ctx, ctx->ev, sd_ctx, &sbus_srv, sbus_address, dbus_service_init, ctx); ctx->sbus_srv = sbus_srv; return ret; diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index 40012808..cc63b045 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -451,7 +451,8 @@ static int dp_srv_init(struct dp_ctx *dpctx) sd_ctx->methods = dp_sbus_methods; sd_ctx->message_handler = sbus_message_handler; - ret = sbus_new_server(dpctx->ev, sd_ctx, + ret = sbus_new_server(dpctx, + dpctx->ev, sd_ctx, &sbus_srv, dpbus_address, dbus_dp_init, dpctx); if (ret != EOK) { diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h index 39846994..cf59a22f 100644 --- a/server/sbus/sssd_dbus.h +++ b/server/sbus/sssd_dbus.h @@ -67,7 +67,8 @@ struct sbus_message_handler_ctx { }; /* Server Functions */ -int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, +int sbus_new_server(TALLOC_CTX *mem_ctx, + struct event_context *ev, struct sbus_method_ctx *ctx, struct sbus_srv_ctx **server_ctx, const char *address, sbus_server_conn_init_fn init_fn, void *init_pvt_data); diff --git a/server/sbus/sssd_dbus_server.c b/server/sbus/sssd_dbus_server.c index d1d93739..4f38345c 100644 --- a/server/sbus/sssd_dbus_server.c +++ b/server/sbus/sssd_dbus_server.c @@ -253,7 +253,8 @@ static void sbus_server_init_new_connection(DBusServer *server, * Set up a D-BUS server, integrate with the event loop * for handling file descriptor and timed events */ -int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, +int sbus_new_server(TALLOC_CTX *mem_ctx, + struct event_context *ev, struct sbus_method_ctx *ctx, struct sbus_srv_ctx **server_ctx, const char *address, sbus_server_conn_init_fn init_fn, void *init_pvt_data) { @@ -278,7 +279,7 @@ int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, DEBUG(3, ("D-BUS Server listening on %s\n", tmp)); free(tmp); - srv_ctx = talloc_zero(ev, struct sbus_srv_ctx); + srv_ctx = talloc_zero(mem_ctx, struct sbus_srv_ctx); if (!srv_ctx) { return ENOMEM; } -- cgit