From 8341d4fa04e77afce1a68e920a6a684624ddb2b6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 16 Feb 2017 12:03:39 +0100 Subject: core: when booting up, initialize hostname to compile-time fallback hostname When /etc/hostname isn't set, default to the configured compile-time fallback hostname instead of "localhost" for the kernel hostname. --- src/core/hostname-setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hostname-setup.c') diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c index 68be52856b..845e31e1c5 100644 --- a/src/core/hostname-setup.c +++ b/src/core/hostname-setup.c @@ -31,10 +31,10 @@ #include "util.h" int hostname_setup(void) { - int r; _cleanup_free_ char *b = NULL; - const char *hn; bool enoent = false; + const char *hn; + int r; r = read_hostname_config("/etc/hostname", &b); if (r < 0) { @@ -56,7 +56,7 @@ int hostname_setup(void) { if (enoent) log_info("No hostname configured."); - hn = "localhost"; + hn = FALLBACK_HOSTNAME; } r = sethostname_idempotent(hn); -- cgit v1.2.3-54-g00ecf