summaryrefslogtreecommitdiff
path: root/src/core/path.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-17 02:27:06 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-17 02:50:05 +0100
commit74051b9b5865586bf4d30b9075649af838fb92bd (patch)
tree1dd547147c395f7e3fec22285da4a83f54644d89 /src/core/path.c
parent4b20075e2fbd99caee8b6a782050969a087a1a21 (diff)
units: for all unit settings that take lists, allow the empty string for resetting the lists
https://bugzilla.redhat.com/show_bug.cgi?id=756787
Diffstat (limited to 'src/core/path.c')
-rw-r--r--src/core/path.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/path.c b/src/core/path.c
index 767620ba7..3775577bc 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -248,22 +248,28 @@ static void path_init(Unit *u) {
p->directory_mode = 0755;
}
-static void path_done(Unit *u) {
- Path *p = PATH(u);
+void path_free_specs(Path *p) {
PathSpec *s;
assert(p);
- unit_ref_unset(&p->unit);
-
while ((s = p->specs)) {
- path_spec_unwatch(s, u);
+ path_spec_unwatch(s, UNIT(p));
LIST_REMOVE(PathSpec, spec, p->specs, s);
path_spec_done(s);
free(s);
}
}
+static void path_done(Unit *u) {
+ Path *p = PATH(u);
+
+ assert(p);
+
+ unit_ref_unset(&p->unit);
+ path_free_specs(p);
+}
+
int path_add_one_mount_link(Path *p, Mount *m) {
PathSpec *s;
int r;