]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hostnamed: improve message about static hostname
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 12 Dec 2020 12:34:48 +0000 (13:34 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 16 Dec 2020 10:02:18 +0000 (11:02 +0100)
Changed static hostname to 'n/a' is not very nice.

src/hostname/hostnamed.c

index c41d5fd741f473045d4b388d077649c83551dc5a..43b5c1161244776369cbeea8487ca35d8d6265ea 100644 (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);