X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fhostname-setup.c;h=57baa7927504197d881a024ede7304cfad18ad3a;hb=45071fcaa03eafc27352987fa2277b2792725036;hp=8aa1cff1d30f23ad1a42826a487a7e8540a11beb;hpb=e724b0639c43c2821613fc4f7f755f87c49a22e8;p=elogind.git diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c index 8aa1cff1d..57baa7927 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; }