chiark / gitweb /
bus-proxyd: explicitly address messages to unique and well-known name
[elogind.git] / src / core / hostname-setup.c
index ac508af122a3104c4cad7b049451b2e8e082527d..57baa7927504197d881a024ede7304cfad18ad3a 100644 (file)
@@ -42,7 +42,7 @@ static int read_and_strip_hostname(const char *path, char **hn) {
         if (r < 0)
                 return r;
 
-        hostname_cleanup(s);
+        hostname_cleanup(s, false);
 
         if (isempty(s)) {
                 free(s);
@@ -82,7 +82,7 @@ int hostname_setup(void) {
                 hn = "localhost";
         }
 
-        if (sethostname(hn, strlen(hn)) < 0) {
+        if (sethostname_idempotent(hn) < 0) {
                 log_warning("Failed to set hostname to <%s>: %m", hn);
                 return -errno;
         }