shared/dropin: rename function for clarity

The caller looks for directories and is called "..._find_dirs()". Here, there
is no "finding" going on, so I found the old name confusing.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-07-19 16:51:14 +02:00
parent f1b4b94cae
commit 47a0011186
+4 -2
View File
@@ -93,7 +93,7 @@ int write_drop_in_format(const char *dir, const char *unit, unsigned level,
return write_drop_in(dir, unit, level, name, p);
}
static int unit_file_find_dir(
static int unit_file_add_dir(
const char *original_root,
const char *path,
char ***dirs) {
@@ -103,6 +103,8 @@ static int unit_file_find_dir(
assert(path);
/* This adds [original_root]/path to dirs, if it exists. */
r = chase_symlinks(path, original_root, 0, &chased);
if (r == -ENOENT) /* Ignore -ENOENT, after all most units won't have a drop-in dir. */
return 0;
@@ -143,7 +145,7 @@ static int unit_file_find_dirs(
path = strjoina(unit_path, "/", name, suffix);
if (!unit_path_cache || set_get(unit_path_cache, path)) {
r = unit_file_find_dir(original_root, path, dirs);
r = unit_file_add_dir(original_root, path, dirs);
if (r < 0)
return r;
}