chiark / gitweb /
switch from udev keymaps to hwdb
[elogind.git] / src / hostname / hostnamed.c
index 859b5a07845400ce1bd86523f642422415802d53..0437e33a664c18016ab0319552ebe088c15719a5 100644 (file)
@@ -289,7 +289,7 @@ static int write_data_static_hostname(void) {
 
                 return 0;
         }
-        return write_one_line_file_atomic_label("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
+        return write_string_file_atomic_label("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
 }
 
 static int write_data_other(void) {
@@ -303,7 +303,7 @@ static int write_data_other(void) {
         char **l = NULL;
         int r, p;
 
-        r = load_env_file("/etc/machine-info", &l);
+        r = load_env_file("/etc/machine-info", NULL, &l);
         if (r < 0 && r != -ENOENT)
                 return r;
 
@@ -444,7 +444,7 @@ static DBusHandlerResult hostname_message_handler(
                                 return bus_send_error_reply(connection, message, NULL, r);
                         }
 
-                        log_info("Changed host name to '%s'", strempty(data[PROP_HOSTNAME]));
+                        log_info("Changed host name to '%s'", strna(data[PROP_HOSTNAME]));
 
                         changed = bus_properties_changed_new(
                                         "/org/freedesktop/hostname1",
@@ -498,7 +498,7 @@ static DBusHandlerResult hostname_message_handler(
                                 return bus_send_error_reply(connection, message, NULL, r);
                         }
 
-                        log_info("Changed static host name to '%s'", strempty(data[PROP_STATIC_HOSTNAME]));
+                        log_info("Changed static host name to '%s'", strna(data[PROP_STATIC_HOSTNAME]));
 
                         changed = bus_properties_changed_new(
                                         "/org/freedesktop/hostname1",
@@ -574,7 +574,7 @@ static DBusHandlerResult hostname_message_handler(
 
                         log_info("Changed %s to '%s'",
                                  k == PROP_PRETTY_HOSTNAME ? "pretty host name" :
-                                 k == PROP_CHASSIS ? "chassis" : "icon name", strempty(data[k]));
+                                 k == PROP_CHASSIS ? "chassis" : "icon name", strna(data[k]));
 
                         changed = bus_properties_changed_new(
                                         "/org/freedesktop/hostname1",