chiark / gitweb /
util: introduce sethostname_idempotent
[elogind.git] / src / hostname / hostnamed.c
index 0cffb5f683a742f0febcd2fdd2c6181f4e3f8dac..a449610bb86c2593c3d0408ebab2dc82990b2293 100644 (file)
@@ -287,7 +287,7 @@ static int context_update_kernel_hostname(Context *c) {
         else
                 hn = "localhost";
 
-        if (sethostname(hn, strlen(hn)) < 0)
+        if (sethostname_idempotent(hn) < 0)
                 return -errno;
 
         return 0;