summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-02 15:13:30 +0200
committerTom Gundersen <teg@jklm.no>2014-06-02 15:14:32 +0200
commitb686acb27ea4de042320fa196cfb14e08f30165b (patch)
treea78a60a5c96c069cf22cb75e25c80324aca49a1e /src/resolve
parent01501939d5f608541c1ea98fe2da84d841f9c9bc (diff)
resolved: move resolv.conf to resolved's runtime dir
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-manager.c8
-rw-r--r--src/resolve/resolved.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index ae173991da..3ed0603f9b 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -30,7 +30,6 @@
#include "dhcp-lease-internal.h"
#include "network-internal.h"
#include "conf-parser.h"
-#include "mkdir.h"
static int set_fallback_dns(Manager *m, const char *string) {
char *word, *state;
@@ -192,6 +191,7 @@ static void append_dns(FILE *f, void *dns, unsigned char family, unsigned *count
}
int manager_update_resolv_conf(Manager *m) {
+ const char *path = "/run/systemd/resolve/resolv.conf";
_cleanup_free_ char *temp_path = NULL;
_cleanup_fclose_ FILE *f = NULL;
_cleanup_free_ unsigned *indices = NULL;
@@ -201,7 +201,7 @@ int manager_update_resolv_conf(Manager *m) {
assert(m);
- r = fopen_temporary("/run/systemd/network/resolv.conf", &f, &temp_path);
+ r = fopen_temporary(path, &f, &temp_path);
if (r < 0)
return r;
@@ -263,9 +263,9 @@ int manager_update_resolv_conf(Manager *m) {
fflush(f);
- if (ferror(f) || rename(temp_path, "/run/systemd/network/resolv.conf") < 0) {
+ if (ferror(f) || rename(temp_path, path) < 0) {
r = -errno;
- unlink("/run/systemd/network/resolv.conf");
+ unlink(path);
unlink(temp_path);
return r;
}
diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c
index 82f43d6803..2eaff60fce 100644
--- a/src/resolve/resolved.c
+++ b/src/resolve/resolved.c
@@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
}
/* Always create the directory where resolv.conf will live */
- r = mkdir_label("/run/systemd/network", 0755);
+ r = mkdir_label("/run/systemd/resolve", 0755);
if (r < 0)
log_error("Could not create runtime directory: %s",
strerror(-r));