From e6a54582f5b8533ff17438c3e0685ea7b5016d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Mon, 30 Oct 2023 12:32:42 +0100 Subject: [PATCH] sbus: make sbus_connect_private_send static Asynchronous connection to D-Bus is only needed when creating a server and that is done by `sbus_server_create_and_connect_send`. Non-blocking connection does not make sense on other places in SSSD because we use D-Bus for IPC therefore if D-Bus connection is not functional, our process can not function as well and therefore the blocking connection actually makes more sense. --- src/sbus/connection/sbus_connection_connect.c | 9 ++-- src/sbus/sbus.h | 45 ------------------- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/src/sbus/connection/sbus_connection_connect.c b/src/sbus/connection/sbus_connection_connect.c index edc090e156f..de6865039a3 100644 --- a/src/sbus/connection/sbus_connection_connect.c +++ b/src/sbus/connection/sbus_connection_connect.c @@ -222,7 +222,7 @@ struct sbus_connect_private_state { static void sbus_connect_private_done(struct tevent_req *subreq); -struct tevent_req * +static struct tevent_req * sbus_connect_private_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, const char *address, @@ -318,9 +318,10 @@ static void sbus_connect_private_done(struct tevent_req *subreq) return; } -errno_t sbus_connect_private_recv(TALLOC_CTX *mem_ctx, - struct tevent_req *req, - struct sbus_connection **_conn) +static errno_t +sbus_connect_private_recv(TALLOC_CTX *mem_ctx, + struct tevent_req *req, + struct sbus_connection **_conn) { struct sbus_connect_private_state *state; state = tevent_req_data(req, struct sbus_connect_private_state); diff --git a/src/sbus/sbus.h b/src/sbus/sbus.h index 0983879f0eb..77fd506cf75 100644 --- a/src/sbus/sbus.h +++ b/src/sbus/sbus.h @@ -84,51 +84,6 @@ sbus_connect_private(TALLOC_CTX *mem_ctx, const char *dbus_name, time_t *last_activity_time); -/** - * Connect to a private D-Bus bus at @address an perform its initialization - * asynchronously. Usually, you can just call @sbus_connect_private which - * will block for a while during Hello and RequestName calls, which is mostly - * ok since it is done during process initialization. However, you have to - * use asynchronous call if you are connecting to a server which runs on the - * same process, otherwise it will end up in dead lock. - * - * If @last_activity_time pointer is given, it is updated with current time - * each time an important event (such as method or property call) on the bus - * occurs. It is not updated when an signal arrives. - * - * @param mem_ctx Memory context. - * @param ev Tevent context. - * @param address Remote end-point address. - * @param dbus_name Name of this end-point. - * @param last_activity_time Pointer to a time that is updated each time - * an event occurs. - * - * @return Tevent request or NULL on error. - * - * @see sbus_server_create - */ -struct tevent_req * -sbus_connect_private_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - const char *address, - const char *dbus_name, - time_t *last_activity_time); - -/** - * Recieve reply from @sbus_connect_private_send. - * - * @param mem_ctx Memory context. - * @param req Tevent request. - * @param _conn Established sbus connection. - * - * @return EOK on success, other errno code on failure. - * - * @see sbus_server_create - */ -errno_t sbus_connect_private_recv(TALLOC_CTX *mem_ctx, - struct tevent_req *req, - struct sbus_connection **_conn); - /** * Create a new sbus server at socket address @address. *