chiark / gitweb /
util: fix copy-paste error and actually set the new hostname
authorMichal Sekletar <msekleta@redhat.com>
Mon, 27 Oct 2014 10:08:26 +0000 (11:08 +0100)
committerMichal Sekletar <msekleta@redhat.com>
Mon, 27 Oct 2014 10:09:39 +0000 (11:09 +0100)
Reported-by: sztanpet on irc
src/shared/util.c

index 7d94a28302f7d49d6e54d0c66a06e84cb793e2aa..4143f6d643ebca2cb02c105ba0504d1a55d9f72d 100644 (file)
@@ -7189,7 +7189,7 @@ int sethostname_idempotent(const char *s) {
         if (streq(buf, s))
                 return 0;
 
-        r = sethostname(buf, strlen(buf));
+        r = sethostname(s, strlen(s));
         if (r < 0)
                 return -errno;