mirror of
https://github.com/systemd/systemd
synced 2024-10-04 23:31:09 +00:00
path-lookup: move generator_binary_paths() to end of file
Let's keep the code that manipulates LookupPaths together, and move generator_binary_paths() to the end of the .h and .c files, since it is not strictly related to that.
This commit is contained in:
parent
c61b443d32
commit
a69b4fb0f8
|
@ -223,30 +223,6 @@ static char** user_dirs(
|
|||
return tmp;
|
||||
}
|
||||
|
||||
char **generator_binary_paths(UnitFileScope scope) {
|
||||
|
||||
switch (scope) {
|
||||
|
||||
case UNIT_FILE_SYSTEM:
|
||||
return strv_new("/run/systemd/system-generators",
|
||||
"/etc/systemd/system-generators",
|
||||
"/usr/local/lib/systemd/system-generators",
|
||||
SYSTEM_GENERATOR_PATH,
|
||||
NULL);
|
||||
|
||||
case UNIT_FILE_GLOBAL:
|
||||
case UNIT_FILE_USER:
|
||||
return strv_new("/run/systemd/user-generators",
|
||||
"/etc/systemd/user-generators",
|
||||
"/usr/local/lib/systemd/user-generators",
|
||||
USER_GENERATOR_PATH,
|
||||
NULL);
|
||||
|
||||
default:
|
||||
assert_not_reached("Hmm, unexpected scope.");
|
||||
}
|
||||
}
|
||||
|
||||
static int acquire_generator_dirs(
|
||||
UnitFileScope scope,
|
||||
char **generator,
|
||||
|
@ -815,3 +791,27 @@ void lookup_paths_flush_generator(LookupPaths *p) {
|
|||
if (p->generator_late)
|
||||
(void) rm_rf(p->generator_late, REMOVE_ROOT);
|
||||
}
|
||||
|
||||
char **generator_binary_paths(UnitFileScope scope) {
|
||||
|
||||
switch (scope) {
|
||||
|
||||
case UNIT_FILE_SYSTEM:
|
||||
return strv_new("/run/systemd/system-generators",
|
||||
"/etc/systemd/system-generators",
|
||||
"/usr/local/lib/systemd/system-generators",
|
||||
SYSTEM_GENERATOR_PATH,
|
||||
NULL);
|
||||
|
||||
case UNIT_FILE_GLOBAL:
|
||||
case UNIT_FILE_USER:
|
||||
return strv_new("/run/systemd/user-generators",
|
||||
"/etc/systemd/user-generators",
|
||||
"/usr/local/lib/systemd/user-generators",
|
||||
USER_GENERATOR_PATH,
|
||||
NULL);
|
||||
|
||||
default:
|
||||
assert_not_reached("Hmm, unexpected scope.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,8 +58,6 @@ struct LookupPaths {
|
|||
char *root_dir;
|
||||
};
|
||||
|
||||
char **generator_binary_paths(UnitFileScope scope);
|
||||
|
||||
int lookup_paths_init(LookupPaths *p, UnitFileScope scope, const char *root_dir);
|
||||
|
||||
int lookup_paths_reduce(LookupPaths *p);
|
||||
|
@ -70,3 +68,5 @@ void lookup_paths_flush_generator(LookupPaths *p);
|
|||
|
||||
void lookup_paths_free(LookupPaths *p);
|
||||
#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
|
||||
|
||||
char **generator_binary_paths(UnitFileScope scope);
|
||||
|
|
Loading…
Reference in a new issue