]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/resolve/resolved-etc-hosts.c
stat-util: add explicit helpers for checking if stat/statx is initialized
[thirdparty/systemd.git] / src / resolve / resolved-etc-hosts.c
index 2d334d38ddf280a52c79022b2654e5e83456acfe..7b053862139f1ef2d4478558bea5d0219de497f0 100644 (file)
@@ -342,7 +342,7 @@ static int manager_etc_hosts_read(Manager *m) {
 
         m->etc_hosts_last = ts;
 
-        if (m->etc_hosts_stat.st_mode != 0) {
+        if (stat_is_set(&m->etc_hosts_stat)) {
                 if (stat("/etc/hosts", &st) < 0) {
                         if (errno != ENOENT)
                                 return log_error_errno(errno, "Failed to stat /etc/hosts: %m");