summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-08 17:41:41 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-08 22:15:27 -0500
commit2ad8416dd057e7e3185169609ca3006e7649f576 (patch)
tree5dee188dd83213dca612e4509e5ec333290557c1 /src/network/networkd-manager.c
parentd8160f21fd295b451cee9679aa281fedf1cb8e8c (diff)
No need to canonicalize fixed paths
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 4e2cf45791..c9ce1d6a13 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -24,6 +24,15 @@
#include "libudev-private.h"
#include "udev-util.h"
+const char* const network_dirs[] = {
+ "/etc/systemd/network",
+ "/run/systemd/network",
+ "/usr/lib/systemd/network",
+#ifdef HAVE_SPLIT_USER
+ "/lib/systemd/network",
+#endif
+ NULL};
+
int manager_new(Manager **ret) {
_cleanup_manager_free_ Manager *m = NULL;
int r;
@@ -60,19 +69,6 @@ int manager_new(Manager **ret) {
LIST_HEAD_INIT(m->networks);
- m->network_dirs = strv_new("/etc/systemd/network/",
- "/run/systemd/network/",
- "/usr/lib/systemd/network",
-#ifdef HAVE_SPLIT_USER
- "/lib/systemd/network",
-#endif
- NULL);
- if (!m->network_dirs)
- return -ENOMEM;
-
- if (!path_strv_canonicalize_uniq(m->network_dirs))
- return -ENOMEM;
-
*ret = m;
m = NULL;
@@ -100,7 +96,6 @@ void manager_free(Manager *m) {
bridge_free(bridge);
hashmap_free(m->bridges);
- strv_free(m->network_dirs);
sd_rtnl_unref(m->rtnl);
free(m);
@@ -110,7 +105,7 @@ int manager_load_config(Manager *m) {
int r;
/* update timestamp */
- paths_check_timestamp(m->network_dirs, &m->network_dirs_ts_usec, true);
+ paths_check_timestamp(network_dirs, &m->network_dirs_ts_usec, true);
r = bridge_load(m);
if (r < 0)
@@ -124,7 +119,7 @@ int manager_load_config(Manager *m) {
}
bool manager_should_reload(Manager *m) {
- return paths_check_timestamp(m->network_dirs, &m->network_dirs_ts_usec, false);
+ return paths_check_timestamp(network_dirs, &m->network_dirs_ts_usec, false);
}
static int manager_process_link(Manager *m, struct udev_device *device) {