chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: watch SIGCHLD more closely to track processes of units with no reliable cgroup...
[elogind.git]
/
src
/
core
/
load-fragment.c
diff --git
a/src/core/load-fragment.c
b/src/core/load-fragment.c
index d43d1b4162731462fc4b08cec7227089d498308c..7a2d32ddbd6c3a80c2f4acb9bdaceee85354361c 100644
(file)
--- a/
src/core/load-fragment.c
+++ b/
src/core/load-fragment.c
@@
-2431,9
+2431,9
@@
static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
/* Add the file name we are currently looking at to
* the names of this unit, but only if it is a valid
* unit name. */
/* Add the file name we are currently looking at to
* the names of this unit, but only if it is a valid
* unit name. */
- name =
path_get_file_
name(*filename);
+ name =
base
name(*filename);
- if (unit_name_is_valid(name,
true
)) {
+ if (unit_name_is_valid(name,
TEMPLATE_VALID
)) {
id = set_get(names, name);
if (!id) {
id = set_get(names, name);
if (!id) {
@@
-2680,31
+2680,28
@@
int unit_load_fragment(Unit *u) {
/* Look for a template */
if (u->load_state == UNIT_STUB && u->instance) {
/* Look for a template */
if (u->load_state == UNIT_STUB && u->instance) {
- char *k;
+
_cleanup_free_
char *k;
k = unit_name_template(u->id);
if (!k)
return -ENOMEM;
r = load_from_path(u, k);
k = unit_name_template(u->id);
if (!k)
return -ENOMEM;
r = load_from_path(u, k);
- free(k);
-
if (r < 0)
return r;
if (u->load_state == UNIT_STUB)
SET_FOREACH(t, u->names, i) {
if (r < 0)
return r;
if (u->load_state == UNIT_STUB)
SET_FOREACH(t, u->names, i) {
+ _cleanup_free_ char *z = NULL;
if (t == u->id)
continue;
if (t == u->id)
continue;
-
k
= unit_name_template(t);
- if (!
k
)
+
z
= unit_name_template(t);
+ if (!
z
)
return -ENOMEM;
return -ENOMEM;
- r = load_from_path(u, k);
- free(k);
-
+ r = load_from_path(u, z);
if (r < 0)
return r;
if (r < 0)
return r;