r = stat("/etc/resolv.conf", &st);
if (r < 0) {
if (errno == ENOENT)
- r = 0;
- else
- r = log_warning_errno(errno, "Failed to stat /etc/resolv.conf: %m");
+ return 0;
+
+ r = log_warning_errno(errno, "Failed to stat /etc/resolv.conf: %m");
goto clear;
}
if (t == m->resolv_conf_mtime)
return 0;
- m->resolv_conf_mtime = t;
-
/* Is it symlinked to our own file? */
if (stat("/run/systemd/resolve/resolv.conf", &own) >= 0 &&
st.st_dev == own.st_dev &&
- st.st_ino == own.st_ino) {
- r = 0;
- goto clear;
- }
+ st.st_ino == own.st_ino)
+ return 0;
f = fopen("/etc/resolv.conf", "re");
if (!f) {
if (errno == ENOENT)
- r = 0;
- else
- r = log_warning_errno(errno, "Failed to open /etc/resolv.conf: %m");
+ return 0;
+
+ r = log_warning_errno(errno, "Failed to open /etc/resolv.conf: %m");
goto clear;
}
}
}
+ m->resolv_conf_mtime = t;
+
/* Flush out all servers and search domains that are still
* marked. Those are then ones that didn't appear in the new
* /etc/resolv.conf */