summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-24 16:47:20 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-25 21:58:37 +0100
commite3528a5c46c815974d4d17ea9964278f7ee9caae (patch)
tree6a7c4b5615ef831ef92c0f3f293d83b6858675fc /src/resolve
parent97f1b2f35478fe8aee5d18dac1a1aa2bb16e6fec (diff)
resolved: /etc/resolved.conf missing is not an error
Don't propagate any error in this case, it's really not an error.
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;
}