summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-07-28 03:20:24 +0200
committerLennart Poettering <lennart@poettering.net>2015-07-28 03:20:24 +0200
commitcd3d7c00bfe8b87485bcbec57cce66d8cf98e056 (patch)
tree5c81b0a09e58d470b5cae622644efa7f0992bf73 /src/shared
parent4e5c1db95d06ad812de1a9f881be459b893b18c4 (diff)
parent8508ea9d05242afa8f4748ea01890f521fef0d9f (diff)
Merge pull request #375 from msekletar/test-install-crashers
install: make unit_file_get_list aware of UNIT_FILE_INDIRECT
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/install.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index c37cf1948a..3d2b5ae77f 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -2190,6 +2190,7 @@ int unit_file_get_list(
_cleanup_(unit_file_list_free_onep) UnitFileList *f = NULL;
struct dirent *de;
_cleanup_free_ char *path = NULL;
+ bool also = false;
errno = 0;
de = readdir(d);
@@ -2243,7 +2244,7 @@ int unit_file_get_list(
if (!path)
return -ENOMEM;
- r = unit_file_can_install(&paths, root_dir, path, true, NULL);
+ r = unit_file_can_install(&paths, root_dir, path, true, &also);
if (r == -EINVAL || /* Invalid setting? */
r == -EBADMSG || /* Invalid format? */
r == -ENOENT /* Included file not found? */)
@@ -2253,7 +2254,7 @@ int unit_file_get_list(
else if (r > 0)
f->state = UNIT_FILE_DISABLED;
else
- f->state = UNIT_FILE_STATIC;
+ f->state = also ? UNIT_FILE_INDIRECT : UNIT_FILE_STATIC;
found:
r = hashmap_put(h, basename(f->path), f);