summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-07 23:03:17 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-07 23:03:17 +0200
commit987d561fe202568c0a2880cf047c7833fd365c7a (patch)
treeedb188efc7769a7c936b41e00eb8f2fe9dd9f7f7 /src
parentde48d5ab62e452b596d6f2762422d0ab32c4d313 (diff)
resolved: let config_parse() open the configuration file for us
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-manager.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index 3ed0603f9b..0e2b85b5a9 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -97,23 +97,13 @@ int config_parse_dnsv(
}
static int manager_parse_config_file(Manager *m) {
- static const char fn[] = "/etc/systemd/resolved.conf";
- _cleanup_fclose_ FILE *f = NULL;
int r;
assert(m);
- f = fopen(fn, "re");
- if (!f) {
- if (errno == ENOENT)
- return 0;
-
- log_warning("Failed to open configuration file %s: %m", fn);
- return -errno;
- }
-
- r = config_parse(NULL, fn, f, "Resolve\0", config_item_perf_lookup,
- (void*) resolved_gperf_lookup, false, false, m);
+ r = config_parse(NULL, "/etc/systemd/resolved.conf", NULL,
+ "Resolve\0", config_item_perf_lookup, (void*) resolved_gperf_lookup,
+ false, false, m);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));