1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

tree-wide: get rid of a few more explicit bus parameters

This commit is contained in:
Lennart Poettering 2015-04-29 19:10:09 +02:00
parent 8f88ecf623
commit 966c66e349
4 changed files with 8 additions and 10 deletions

View File

@ -147,13 +147,11 @@ static int signal_activation_request(sd_bus_message *message, void *userdata, sd
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
Manager *m = userdata;
const char *name;
sd_bus *bus;
Unit *u;
int r;
assert(message);
assert(m);
assert_se(bus = sd_bus_message_get_bus(message));
r = sd_bus_message_read(message, "s", &name);
if (r < 0) {
@ -189,7 +187,7 @@ failed:
log_debug("D-Bus activation failed for %s: %s", name, bus_error_message(&error, r));
r = sd_bus_message_new_signal(bus, &reply, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Activator", "ActivationFailure");
r = sd_bus_message_new_signal(sd_bus_message_get_bus(message), &reply, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Activator", "ActivationFailure");
if (r < 0) {
bus_log_create_error(r);
return 0;
@ -201,7 +199,7 @@ failed:
return 0;
}
r = sd_bus_send_to(bus, reply, "org.freedesktop.DBus", NULL);
r = sd_bus_send_to(NULL, reply, "org.freedesktop.DBus", NULL);
if (r < 0)
return log_error_errno(r, "Failed to respond with to bus activation request: %m");

View File

@ -339,7 +339,7 @@ static int bus_method_resolve_hostname(sd_bus_message *message, void *userdata,
q->request_hostname = hostname;
q->complete = bus_method_resolve_hostname_complete;
r = dns_query_bus_track(q, sd_bus_message_get_bus(message), message);
r = dns_query_bus_track(q, message);
if (r < 0)
return r;
@ -491,7 +491,7 @@ static int bus_method_resolve_address(sd_bus_message *message, void *userdata, s
memcpy(&q->request_address, d, sz);
q->complete = bus_method_resolve_address_complete;
r = dns_query_bus_track(q, sd_bus_message_get_bus(message), message);
r = dns_query_bus_track(q, message);
if (r < 0)
return r;
@ -643,7 +643,7 @@ static int bus_method_resolve_record(sd_bus_message *message, void *userdata, sd
q->request_hostname = name;
q->complete = bus_method_resolve_record_complete;
r = dns_query_bus_track(q, sd_bus_message_get_bus(message), message);
r = dns_query_bus_track(q, message);
if (r < 0)
return r;

View File

@ -467,14 +467,14 @@ static int on_bus_track(sd_bus_track *t, void *userdata) {
return 0;
}
int dns_query_bus_track(DnsQuery *q, sd_bus *bus, sd_bus_message *m) {
int dns_query_bus_track(DnsQuery *q, sd_bus_message *m) {
int r;
assert(q);
assert(m);
if (!q->bus_track) {
r = sd_bus_track_new(bus, &q->bus_track, on_bus_track, q);
r = sd_bus_track_new(sd_bus_message_get_bus(m), &q->bus_track, on_bus_track, q);
if (r < 0)
return r;
}

View File

@ -75,6 +75,6 @@ void dns_query_ready(DnsQuery *q);
int dns_query_cname_redirect(DnsQuery *q, const char *name);
int dns_query_bus_track(DnsQuery *q, sd_bus *bus, sd_bus_message *m);
int dns_query_bus_track(DnsQuery *q, sd_bus_message *m);
DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuery*, dns_query_free);