This addresses
https://github.com/systemd/systemd/pull/41213#pullrequestreview-
4002247053
which I somehow missed earlier.
Claude found a real issue for the case of manager_etc_hosts_flush().
We'll do the equivalent change in manager_static_records_flush() too,
even though it's not really necessary there, simply to keep things
nicely mirrored.
void manager_etc_hosts_flush(Manager *m) {
etc_hosts_clear(&m->etc_hosts);
m->etc_hosts_stat = (struct stat) {};
- m->etc_hosts_last = USEC_INFINITY;
+ /* NB: We do not reset m->etc_hosts_last here, because manager_etc_hosts_read() calls us and needs it
+ * to stay in effect for the reload suppression to work */
}
static int parse_line(EtcHosts *hosts, unsigned nr, const char *line) {
manager_etc_hosts_flush(m);
manager_static_records_flush(m);
+ m->etc_hosts_last = USEC_INFINITY;
+ m->static_records_last = USEC_INFINITY;
+
manager_set_defaults(m);
r = dns_trust_anchor_load(&m->trust_anchor);
m->static_records = hashmap_free(m->static_records);
m->static_records_stat = set_free(m->static_records_stat);
- m->static_records_last = USEC_INFINITY;
}