Commit 93e1cf57 authored by Simon McVittie's avatar Simon McVittie

bus_driver_send_ack_reply: Make available to other modules

Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
parent 032bb720
...@@ -966,11 +966,11 @@ bus_driver_handle_activate_service (DBusConnection *connection, ...@@ -966,11 +966,11 @@ bus_driver_handle_activate_service (DBusConnection *connection,
return retval; return retval;
} }
static dbus_bool_t dbus_bool_t
send_ack_reply (DBusConnection *connection, bus_driver_send_ack_reply (DBusConnection *connection,
BusTransaction *transaction, BusTransaction *transaction,
DBusMessage *message, DBusMessage *message,
DBusError *error) DBusError *error)
{ {
DBusMessage *reply; DBusMessage *reply;
...@@ -1266,8 +1266,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, ...@@ -1266,8 +1266,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
} }
} }
if (!send_ack_reply (connection, transaction, if (!bus_driver_send_ack_reply (connection, transaction, message, error))
message, error))
goto out; goto out;
retval = TRUE; retval = TRUE;
...@@ -1354,8 +1353,7 @@ bus_driver_handle_add_match (DBusConnection *connection, ...@@ -1354,8 +1353,7 @@ bus_driver_handle_add_match (DBusConnection *connection,
goto failed; goto failed;
} }
if (!send_ack_reply (connection, transaction, if (!bus_driver_send_ack_reply (connection, transaction, message, error))
message, error))
{ {
bus_matchmaker_remove_rule (matchmaker, rule); bus_matchmaker_remove_rule (matchmaker, rule);
goto failed; goto failed;
...@@ -1405,8 +1403,7 @@ bus_driver_handle_remove_match (DBusConnection *connection, ...@@ -1405,8 +1403,7 @@ bus_driver_handle_remove_match (DBusConnection *connection,
/* Send the ack before we remove the rule, since the ack is undone /* Send the ack before we remove the rule, since the ack is undone
* on transaction cancel, but rule removal isn't. * on transaction cancel, but rule removal isn't.
*/ */
if (!send_ack_reply (connection, transaction, if (!bus_driver_send_ack_reply (connection, transaction, message, error))
message, error))
goto failed; goto failed;
matchmaker = bus_connection_get_matchmaker (connection); matchmaker = bus_connection_get_matchmaker (connection);
...@@ -2249,7 +2246,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection, ...@@ -2249,7 +2246,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
/* Send the ack before we remove the rule, since the ack is undone /* Send the ack before we remove the rule, since the ack is undone
* on transaction cancel, but becoming a monitor isn't. * on transaction cancel, but becoming a monitor isn't.
*/ */
if (!send_ack_reply (connection, transaction, message, error)) if (!bus_driver_send_ack_reply (connection, transaction, message, error))
goto out; goto out;
if (!bus_connection_be_monitor (connection, transaction, &rules, error)) if (!bus_connection_be_monitor (connection, transaction, &rules, error))
...@@ -2337,7 +2334,7 @@ bus_driver_handle_ping (DBusConnection *connection, ...@@ -2337,7 +2334,7 @@ bus_driver_handle_ping (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
DBusError *error) DBusError *error)
{ {
return send_ack_reply (connection, transaction, message, error); return bus_driver_send_ack_reply (connection, transaction, message, error);
} }
static dbus_bool_t bus_driver_handle_get (DBusConnection *connection, static dbus_bool_t bus_driver_handle_get (DBusConnection *connection,
......
...@@ -62,5 +62,9 @@ BusDriverFound bus_driver_get_conn_helper (DBusConnection *connection, ...@@ -62,5 +62,9 @@ BusDriverFound bus_driver_get_conn_helper (DBusConnection *connection,
const char **name_p, const char **name_p,
DBusConnection **peer_conn_p, DBusConnection **peer_conn_p,
DBusError *error); DBusError *error);
dbus_bool_t bus_driver_send_ack_reply (DBusConnection *connection,
BusTransaction *transaction,
DBusMessage *message,
DBusError *error);
#endif /* BUS_DRIVER_H */ #endif /* BUS_DRIVER_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment