hostname-setup: clarify that failures reading /etc/hostname are ignored

This commit is contained in:
Lennart Poettering 2020-12-11 16:43:39 +01:00
parent 52ef5dd798
commit d4e9809465
1 changed files with 5 additions and 6 deletions

View File

@ -34,12 +34,11 @@ int hostname_setup(void) {
if (!hn) { if (!hn) {
r = read_etc_hostname(NULL, &b); r = read_etc_hostname(NULL, &b);
if (r < 0) { if (r == -ENOENT)
if (r == -ENOENT) enoent = true;
enoent = true; else if (r < 0)
else log_warning_errno(r, "Failed to read configured hostname, ignoring: %m");
log_warning_errno(r, "Failed to read configured hostname: %m"); else
} else
hn = b; hn = b;
} }