Skip to content

Commit

Permalink
unit drop-in: Fix ordering of special type.d drop-ins
Browse files Browse the repository at this point in the history
  • Loading branch information
GothAck committed Dec 27, 2019
1 parent f5dd6e5 commit e6627f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shared/dropin.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ int unit_file_find_dropin_paths(

assert(ret);

SET_FOREACH(name, names, i)
STRV_FOREACH(p, lookup_path)
(void) unit_file_find_dirs(original_root, unit_path_cache, *p, name, dir_suffix, &dirs);

/* All the names in the unit are of the same type so just grab one. */
name = (char*) set_first(names);
if (name) {
Expand All @@ -247,7 +251,7 @@ int unit_file_find_dropin_paths(
"Failed to to derive unit type from unit name: %s",
name);

/* Special top level drop in for "<unit type>.<suffix>". Add this first as it's the most generic
/* Special top level drop in for "<unit type>.<suffix>". Add this last as it's the most generic
* and should be able to be overridden by more specific drop-ins. */
STRV_FOREACH(p, lookup_path)
(void) unit_file_find_dirs(original_root,
Expand All @@ -258,10 +262,6 @@ int unit_file_find_dropin_paths(
&dirs);
}

SET_FOREACH(name, names, i)
STRV_FOREACH(p, lookup_path)
(void) unit_file_find_dirs(original_root, unit_path_cache, *p, name, dir_suffix, &dirs);

if (strv_isempty(dirs)) {
*ret = NULL;
return 0;
Expand Down

0 comments on commit e6627f2

Please sign in to comment.