diff options
author | Pavel Březina <pbrezina@redhat.com> | 2014-12-10 19:24:58 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-01-23 21:29:17 +0100 |
commit | 9fa95168d80beba04b333b06edc492ecb8b085a1 (patch) | |
tree | 00071230415551a49b871f95a60f62ea392a8113 /src/providers/proxy | |
parent | d6ddc35574ba897cf9b5de3350086d9d8604f06f (diff) | |
download | sssd-9fa95168d80beba04b333b06edc492ecb8b085a1.tar.gz sssd-9fa95168d80beba04b333b06edc492ecb8b085a1.tar.xz sssd-9fa95168d80beba04b333b06edc492ecb8b085a1.zip |
sbus: add new iface via sbus_conn_register_iface()
Rename sbus_conn_add_interface() to sbus_conn_register_iface()
and remove sbus_new_interface() calls since it is just one more
unnecessary call outside the sbus code.
The function sbus_new_interface() is made static and used
directly in sbus_conn_register_iface().
The name was chosen to better describe what the function is
doing. That it registers an interface on a given object path.
The same interface can be used with different paths so it is
not really about adding an interface.
Preparation for:
https://fedorahosted.org/sssd/ticket/2339
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers/proxy')
-rw-r--r-- | src/providers/proxy/proxy_child.c | 8 | ||||
-rw-r--r-- | src/providers/proxy/proxy_init.c | 11 |
2 files changed, 3 insertions, 16 deletions
diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c index e261b2f58..9876b9328 100644 --- a/src/providers/proxy/proxy_child.c +++ b/src/providers/proxy/proxy_child.c @@ -381,7 +381,6 @@ int proxy_child_send_id(struct sbus_connection *conn, uint32_t id); static int proxy_cli_init(struct pc_ctx *ctx) { - struct sbus_interface *intf; char *sbus_address; int ret; @@ -399,12 +398,7 @@ static int proxy_cli_init(struct pc_ctx *ctx) return ret; } - intf = sbus_new_interface(ctx, DP_PATH, &pc_methods.vtable, ctx); - if (!intf) { - ret = ENOMEM; - } else { - ret = sbus_conn_add_interface(ctx->conn, intf); - } + ret = sbus_conn_register_iface(ctx->conn, &pc_methods.vtable, DP_PATH, ctx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, "Failed to export proxy.\n"); return ret; diff --git a/src/providers/proxy/proxy_init.c b/src/providers/proxy/proxy_init.c index 1e7345117..f76ad02ae 100644 --- a/src/providers/proxy/proxy_init.c +++ b/src/providers/proxy/proxy_init.c @@ -331,7 +331,6 @@ static int proxy_client_init(struct sbus_connection *conn, void *data) { struct proxy_auth_ctx *proxy_auth_ctx; struct proxy_client *proxy_cli; - struct sbus_interface *intf; struct timeval tv; proxy_auth_ctx = talloc_get_type(data, struct proxy_auth_ctx); @@ -362,14 +361,8 @@ static int proxy_client_init(struct sbus_connection *conn, void *data) DEBUG(SSSDBG_CONF_SETTINGS, "Set-up proxy client ID timeout [%p]\n", proxy_cli->timeout); - /* Attach the client context to the connection context, so that it is - * always available when we need to manage the connection. */ - intf = sbus_new_interface(conn, DP_PATH, &proxy_methods.vtable, proxy_cli); - if (!intf) { - return ENOMEM; - } - - return sbus_conn_add_interface(conn, intf); + return sbus_conn_register_iface(conn, &proxy_methods.vtable, + DP_PATH, proxy_cli); } static void init_timeout(struct tevent_context *ev, |