diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-04 20:50:44 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-07 21:31:22 -0500 |
commit | 957787821008f5823804c928c9cdc77bb3910027 (patch) | |
tree | c46828e6d7fd4a9a36522bfcc3a76d0d012d2ea7 /src/shared/dropin.h | |
parent | 5dd11ab5f36ce71138005941ea69458e169b3af6 (diff) |
core: when loading .wants and .requires, follow the same logic as .d conf dropins
Essentially, instead of sequentially adding deps based on all symlinks
encountered in .wants and .requires dirs for each name and each unit file load
path, iteratate over the load paths and unit names gathering symlinks, then
order them based on priority, and then iterate over the final list, adding
dependencies.
This patch doesn't change the logic too much, except that the order in which
dependencies are applied might be different. It wasn't defined before, so that
not really a change. Adding filtering on the symlinks is left for later
patches.
Diffstat (limited to 'src/shared/dropin.h')
-rw-r--r-- | src/shared/dropin.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/shared/dropin.h b/src/shared/dropin.h index 761b250886..22cd2fa229 100644 --- a/src/shared/dropin.h +++ b/src/shared/dropin.h @@ -44,20 +44,24 @@ typedef int (*dependency_consumer_t)(UnitDependency dependency, const char* filepath, void *arg); -int unit_file_process_dir( - const char *original_root, - Set * unit_path_cache, - const char *unit_path, - const char *name, - const char *suffix, - UnitDependency dependency, - dependency_consumer_t consumer, - void *arg, - char ***strv); - int unit_file_find_dropin_paths( const char *original_root, char **lookup_path, Set *unit_path_cache, + const char *dir_suffix, + const char *file_suffix, Set *names, char ***paths); + +static inline int unit_file_find_dropin_conf_paths( + const char *original_root, + char **lookup_path, + Set *unit_path_cache, + Set *names, + char ***paths) { + return unit_file_find_dropin_paths(original_root, + lookup_path, + unit_path_cache, + ".d", ".conf", + names, paths); +} |