The choice what errors to ignore is left to the caller, and the caller is
changed to ignore all errors.
On error, previously read data is kept. So if e.g. an oom error happens, we
will continue to return slightly stale data instead of pretending we have no
entries for the given address. I think that's better, for example when
/etc/hosts contains some important overrides that external DNS should not be
queried for.
return r;
}
+ etc_hosts_free(hosts);
*hosts = t;
t = (EtcHosts) {}; /* prevent cleanup */
return 0;
if (r < 0)
return log_error_errno(errno, "Failed to fstat() /etc/hosts: %m");
- manager_etc_hosts_flush(m);
-
r = etc_hosts_parse(&m->etc_hosts, f);
- if (r == -ENOMEM)
- /* On OOM we bail. All other errors we ignore and proceed. */
+ if (r < 0)
return r;
m->etc_hosts_mtime = timespec_load(&st.st_mtim);
if (!m->read_etc_hosts)
return 0;
- r = manager_etc_hosts_read(m);
- if (r < 0)
- return r;
+ (void) manager_etc_hosts_read(m);
name = dns_question_first_name(q);
if (!name)