path-lookup: make SYSTEMD_UNIT_PATH more flexible

It can now contain more than one directory, and can be used
to only prepend, not totally override, the normal load path.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-07-20 19:48:16 -04:00
parent 8328d8c633
commit cf7d80a5fe
3 changed files with 58 additions and 51 deletions
+1 -4
View File
@@ -2165,11 +2165,8 @@ int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, UnitDep
}
int set_unit_path(const char *p) {
_cleanup_free_ char *c = NULL;
/* This is mostly for debug purposes */
c = path_make_absolute_cwd(p);
if (setenv("SYSTEMD_UNIT_PATH", c, 0) < 0)
if (setenv("SYSTEMD_UNIT_PATH", p, 0) < 0)
return -errno;
return 0;