summaryrefslogtreecommitdiff
path: root/src/core/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-29 18:35:10 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-29 18:36:25 +0200
commit190700621f95160d364f8ec1d3e360246c41ce75 (patch)
tree783c3b43bd6fd93892fada76f5c20112a4e73d7c /src/core/dbus.c
parentb53c3c2d24ed1398ee427139cd880b07bc35fa24 (diff)
sd-bus: drop bus parameter from message callback prototype
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r--src/core/dbus.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 43b2ccd64e..8d72502a1a 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -71,12 +71,11 @@ int bus_send_queued_message(Manager *m) {
return 0;
}
-static int signal_agent_released(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
+static int signal_agent_released(sd_bus_message *message, void *userdata, sd_bus_error *error) {
Manager *m = userdata;
const char *cgroup;
int r;
- assert(bus);
assert(message);
assert(m);
@@ -104,12 +103,13 @@ exit:
return 0;
}
-static int signal_disconnected(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
+static int signal_disconnected(sd_bus_message *message, void *userdata, sd_bus_error *error) {
Manager *m = userdata;
+ sd_bus *bus;
- assert(bus);
assert(message);
assert(m);
+ assert_se(bus = sd_bus_message_get_bus(message));
if (bus == m->api_bus)
destroy_bus(m, &m->api_bus);
@@ -123,12 +123,11 @@ static int signal_disconnected(sd_bus *bus, sd_bus_message *message, void *userd
return 0;
}
-static int signal_name_owner_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
+static int signal_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name, *old_owner, *new_owner;
Manager *m = userdata;
int r;
- assert(bus);
assert(message);
assert(m);
@@ -146,17 +145,18 @@ static int signal_name_owner_changed(sd_bus *bus, sd_bus_message *message, void
return 0;
}
-static int signal_activation_request(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *ret_error) {
+static int signal_activation_request(sd_bus_message *message, void *userdata, sd_bus_error *ret_error) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
Manager *m = userdata;
const char *name;
+ sd_bus *bus;
Unit *u;
int r;
- assert(bus);
assert(message);
assert(m);
+ assert_se(bus = sd_bus_message_get_bus(message));
r = sd_bus_message_read(message, "s", &name);
if (r < 0) {
@@ -212,14 +212,13 @@ failed:
}
#ifdef HAVE_SELINUX
-static int mac_selinux_filter(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
+static int mac_selinux_filter(sd_bus_message *message, void *userdata, sd_bus_error *error) {
Manager *m = userdata;
const char *verb, *path;
Unit *u = NULL;
Job *j;
int r;
- assert(bus);
assert(message);
/* Our own method calls are all protected individually with