diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-24 16:47:20 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-25 21:58:37 +0100 |
commit | e3528a5c46c815974d4d17ea9964278f7ee9caae (patch) | |
tree | 6a7c4b5615ef831ef92c0f3f293d83b6858675fc | |
parent | 97f1b2f35478fe8aee5d18dac1a1aa2bb16e6fec (diff) |
resolved: /etc/resolved.conf missing is not an error
Don't propagate any error in this case, it's really not an error.
-rw-r--r-- | src/resolve/resolved-manager.c | 14 |
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; } |