summaryrefslogtreecommitdiff
path: root/src/shared/path-lookup.c
diff options
context:
space:
mode:
authorIvan Shapovalov <intelfx100@gmail.com>2014-12-19 17:08:07 +0300
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-05 11:13:30 -0500
commit60d27f1916c90871c063819a6e7d586c7a663789 (patch)
tree3affd63ba875e2491f6870c99e0e8c3fe1d5a80c /src/shared/path-lookup.c
parent69c4e2771ec58d111191afe397a402e488e223ba (diff)
path-lookup, systemctl: export lookup_paths_init_from_scope() from shared/install.c and use it
Diffstat (limited to 'src/shared/path-lookup.c')
-rw-r--r--src/shared/path-lookup.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 8f75a8e832..051f1a4835 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -398,3 +398,19 @@ void lookup_paths_free(LookupPaths *p) {
p->sysvinit_path = p->sysvrcnd_path = NULL;
#endif
}
+
+int lookup_paths_init_from_scope(LookupPaths *paths,
+ UnitFileScope scope,
+ const char *root_dir) {
+ assert(paths);
+ assert(scope >= 0);
+ assert(scope < _UNIT_FILE_SCOPE_MAX);
+
+ zero(*paths);
+
+ return lookup_paths_init(paths,
+ scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER,
+ scope == UNIT_FILE_USER,
+ root_dir,
+ NULL, NULL, NULL);
+}