1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 01:55:32 +03:00

networkd: simplify sd_bus_is_ready() checks

Also add "system" in the messages, because we set the internal value,
and are just skipping the setting of the external value, so the message
could be confusing without that clarification.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-04-08 15:04:18 +02:00
parent 3bbb76f621
commit 5dbec9bd32
4 changed files with 7 additions and 8 deletions

View File

@ -167,7 +167,7 @@ int manager_request_product_uuid(Manager *m, Link *link) {
return log_oom();
}
if (!m->bus || sd_bus_is_ready(m->bus) <= 0) {
if (sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, requesting product UUID later.");
return 0;
}

View File

@ -854,7 +854,7 @@ int link_send_changed_strv(Link *link, char **properties) {
assert(link->manager);
assert(properties);
if (!link->manager->bus || sd_bus_is_ready(link->manager->bus) <= 0)
if (sd_bus_is_ready(link->manager->bus) <= 0)
return 0;
p = link_bus_path(link);

View File

@ -339,7 +339,7 @@ int manager_send_changed_strv(Manager *manager, char **properties) {
assert(manager);
assert(properties);
if (!manager->bus || sd_bus_is_ready(manager->bus) <= 0)
if (sd_bus_is_ready(manager->bus) <= 0)
return 0;
return sd_bus_emit_properties_changed_strv(

View File

@ -767,8 +767,8 @@ int manager_set_hostname(Manager *m, const char *hostname) {
if (r < 0)
return r;
if (!m->bus || sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, setting hostname later.");
if (sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, setting system hostname later.");
return 0;
}
@ -784,7 +784,6 @@ int manager_set_hostname(Manager *m, const char *hostname) {
"sb",
hostname,
false);
if (r < 0)
return log_error_errno(r, "Could not set transient hostname: %m");
@ -817,8 +816,8 @@ int manager_set_timezone(Manager *m, const char *tz) {
if (r < 0)
return r;
if (!m->bus || sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, setting timezone later.");
if (sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, setting system timezone later.");
return 0;
}