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/responder | |
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/responder')
-rw-r--r-- | src/responder/common/responder_common.c | 8 | ||||
-rw-r--r-- | src/responder/ifp/ifpsrv.c | 15 |
2 files changed, 4 insertions, 19 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 666abe610..36e7f1594 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -514,7 +514,6 @@ static int sss_dp_init(struct resp_ctx *rctx, const char *cli_name, struct sss_domain_info *domain) { - struct sbus_interface *intf; struct be_conn *be_conn; int ret; @@ -539,12 +538,7 @@ static int sss_dp_init(struct resp_ctx *rctx, return ret; } - intf = sbus_new_interface(rctx, DP_PATH, dp_intf, rctx); - if (!intf) { - ret = ENOMEM; - } else { - ret = sbus_conn_add_interface(be_conn->conn, intf); - } + ret = sbus_conn_register_iface(be_conn->conn, dp_intf, DP_PATH, rctx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, "Failed to export data provider.\n"); return ret; diff --git a/src/responder/ifp/ifpsrv.c b/src/responder/ifp/ifpsrv.c index 0c333bc07..5b7f26ca1 100644 --- a/src/responder/ifp/ifpsrv.c +++ b/src/responder/ifp/ifpsrv.c @@ -178,7 +178,6 @@ sysbus_init(TALLOC_CTX *mem_ctx, DBusError dbus_error; DBusConnection *conn = NULL; struct sysbus_ctx *system_bus = NULL; - struct sbus_interface *sif; int i; errno_t ret; @@ -226,17 +225,9 @@ sysbus_init(TALLOC_CTX *mem_ctx, } for (i = 0; sysbus_ifaces[i].path != NULL; i++) { - sif = sbus_new_interface(system_bus->conn, - sysbus_ifaces[i].path, - sysbus_ifaces[i].iface_vtable, - pvt); - if (sif == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, - "Could not add the sbus interface\n"); - goto fail; - } - - ret = sbus_conn_add_interface(system_bus->conn, sif); + ret = sbus_conn_register_iface(system_bus->conn, + sysbus_ifaces[i].iface_vtable, + sysbus_ifaces[i].path, pvt); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Could not add the interface\n"); |