chiark / gitweb /
util: introduce sethostname_idempotent
[elogind.git] / src / core / hostname-setup.c
index 8aa1cff1d30f23ad1a42826a487a7e8540a11beb..57baa7927504197d881a024ede7304cfad18ad3a 100644 (file)
@@ -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;
         }