From: Lennart Poettering Date: Fri, 11 Dec 2020 15:43:39 +0000 (+0100) Subject: hostname-setup: clarify that failures reading /etc/hostname are ignored X-Git-Tag: v248-rc1~499^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4e98094655a057293e032325be092140f779bc6;p=thirdparty%2Fsystemd.git hostname-setup: clarify that failures reading /etc/hostname are ignored --- diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c index 4e20e764a3c..6ccaa479de2 100644 --- a/src/core/hostname-setup.c +++ b/src/core/hostname-setup.c @@ -34,12 +34,11 @@ int hostname_setup(void) { if (!hn) { r = read_etc_hostname(NULL, &b); - if (r < 0) { - if (r == -ENOENT) - enoent = true; - else - log_warning_errno(r, "Failed to read configured hostname: %m"); - } else + if (r == -ENOENT) + enoent = true; + else if (r < 0) + log_warning_errno(r, "Failed to read configured hostname, ignoring: %m"); + else hn = b; }