summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-12-11 16:43:39 +0100
committerLennart Poettering <lennart@poettering.net>2020-12-15 17:59:58 +0100
commitd4e98094655a057293e032325be092140f779bc6 (patch)
treeb6d3eca6f16729955029e7466baa0772e6124f9b
parent52ef5dd7989d886945e18ab50de31bf5a21ba158 (diff)
downloadsystemd-d4e98094655a057293e032325be092140f779bc6.tar.gz
hostname-setup: clarify that failures reading /etc/hostname are ignored
-rw-r--r--src/core/hostname-setup.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
index 4e20e764a3..6ccaa479de 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;
}