summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hostname-setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
index 8aa1cff1d3..57baa79275 100644
--- a/src/core/hostname-setup.c
+++ b/src/core/hostname-setup.c
@@ -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;
}