}
int unit_load_fragment(Unit *u) {
- const char *fragment;
- _cleanup_set_free_free_ Set *names = NULL;
int r;
assert(u);
if (r < 0)
return log_error_errno(r, "Failed to rebuild name map: %m");
+ const char *fragment;
+ _cleanup_set_free_ Set *names = NULL;
r = unit_file_find_fragment(u->manager->unit_id_map,
u->manager->unit_name_map,
u->id,
return log_error_errno(r, "Failed to get DropInPaths: %s", bus_error_message(&error, r));
}
} else {
- const char *_path;
- _cleanup_set_free_free_ Set *names = NULL;
-
if (!*cached_name_map) {
r = unit_file_build_name_map(lp, NULL, cached_id_map, cached_name_map, NULL);
if (r < 0)
return r;
}
+ const char *_path;
+ _cleanup_set_free_ Set *names = NULL;
r = unit_file_find_fragment(*cached_id_map, *cached_name_map, unit_name, &_path, &names);
if (r < 0)
return log_error_errno(r, "Failed to find fragment for '%s': %m", unit_name);
STRV_FOREACH(id, ids) {
const char *fragment, *name;
- _cleanup_set_free_free_ Set *names = NULL;
+ _cleanup_set_free_ Set *names = NULL;
log_info("*** %s ***", *id);
r = unit_file_find_fragment(unit_ids,
unit_names,