hostnamed: improve message about static hostname

Changed static hostname to 'n/a' is not very nice.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-12-12 13:34:48 +01:00
parent 536970d4f9
commit 468695c8cd
1 changed files with 4 additions and 1 deletions

View File

@ -689,7 +689,10 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_
return sd_bus_error_set_errnof(error, r, "Failed to set static hostname: %m");
}
log_info("Changed static hostname to '%s'", strna(c->data[PROP_STATIC_HOSTNAME]));
if (c->data[PROP_STATIC_HOSTNAME])
log_info("Changed static hostname to <%s>", c->data[PROP_STATIC_HOSTNAME]);
else
log_info("Unset static hostname.");
(void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m),
"/org/freedesktop/hostname1", "org.freedesktop.hostname1", "StaticHostname", NULL);