chiark / gitweb /
util: introduce sethostname_idempotent
[elogind.git] / src / nspawn / nspawn.c
index c567c8d2720fb8ae210e49f22107ccb0154fdc2a..b6d9bc631cb7adf55223806b00d4032dd6d910b4 100644 (file)
@@ -1289,7 +1289,7 @@ static int setup_hostname(void) {
         if (arg_share_system)
                 return 0;
 
-        if (sethostname(arg_machine, strlen(arg_machine)) < 0)
+        if (sethostname_idempotent(arg_machine) < 0)
                 return -errno;
 
         return 0;