chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
efi: set a nice description string in the ESP units
[elogind.git]
/
src
/
core
/
path.c
diff --git
a/src/core/path.c
b/src/core/path.c
index d65339771e3e4fc1c4112ef1be29736909d47f3f..3775577bcf87031b27682f265536b858d040f8b6 100644
(file)
--- a/
src/core/path.c
+++ b/
src/core/path.c
@@
-248,22
+248,28
@@
static void path_init(Unit *u) {
p->directory_mode = 0755;
}
p->directory_mode = 0755;
}
-static void path_done(Unit *u) {
- Path *p = PATH(u);
+void path_free_specs(Path *p) {
PathSpec *s;
assert(p);
PathSpec *s;
assert(p);
- unit_ref_unset(&p->unit);
-
while ((s = p->specs)) {
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);
}
}
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;
int path_add_one_mount_link(Path *p, Mount *m) {
PathSpec *s;
int r;
@@
-307,7
+313,8
@@
static int path_verify(Path *p) {
return 0;
if (!p->specs) {
return 0;
if (!p->specs) {
- log_error("%s lacks path setting. Refusing.", UNIT(p)->id);
+ log_error_unit(UNIT(p)->id,
+ "%s lacks path setting. Refusing.", UNIT(p)->id);
return -EINVAL;
}
return -EINVAL;
}