summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-manager.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index a4ca7c89d3..7c6500e477 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -597,9 +597,10 @@ int manager_read_resolv_conf(Manager *m) {
r = stat("/etc/resolv.conf", &st);
if (r < 0) {
- if (errno != ENOENT)
- log_warning_errno(errno, "Failed to open /etc/resolv.conf: %m");
- r = -errno;
+ if (errno == ENOENT)
+ r = 0;
+ else
+ r = log_warning_errno(errno, "Failed to open /etc/resolv.conf: %m");
goto clear;
}
@@ -620,9 +621,10 @@ int manager_read_resolv_conf(Manager *m) {
f = fopen("/etc/resolv.conf", "re");
if (!f) {
- if (errno != ENOENT)
- log_warning_errno(errno, "Failed to open /etc/resolv.conf: %m");
- r = -errno;
+ if (errno == ENOENT)
+ r = 0;
+ else
+ r = log_warning_errno(errno, "Failed to open /etc/resolv.conf: %m");
goto clear;
}