summaryrefslogtreecommitdiff
path: root/src/shared/install.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-31 15:16:06 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-31 20:42:07 +0200
commitbb2682bc0493ac42bec800e263c4025219012645 (patch)
treeddeb4329279bc25a9a90a084a06b795c5b7d4960 /src/shared/install.c
parent9f77ba244379346d461596bb4901a64a614746e0 (diff)
downloadsystemd-bb2682bc0493ac42bec800e263c4025219012645.tar.gz
Fix reporting of enabled-runtime units
We would always report them as "enabled", because path_is_config() includes /run, despite the name. Fixes #9122.
Diffstat (limited to 'src/shared/install.c')
-rw-r--r--src/shared/install.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index ecda662f28..e246cd727c 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -894,16 +894,13 @@ static int find_symlinks_in_scope(
if (r > 0) {
/* We found symlinks in this dir? Yay! Let's see where precisely it is enabled. */
- r = path_is_config(paths, *p, false);
- if (r < 0)
- return r;
- if (r > 0) {
+ if (path_equal_ptr(*p, paths->persistent_config)) {
/* This is the best outcome, let's return it immediately. */
*state = UNIT_FILE_ENABLED;
return 1;
}
- /* look for globally enablement of user units */
+ /* look for global enablement of user units */
if (scope == UNIT_FILE_USER && path_is_user_config_dir(*p)) {
*state = UNIT_FILE_ENABLED;
return 1;
@@ -918,11 +915,7 @@ static int find_symlinks_in_scope(
enabled_at_all = true;
} else if (same_name_link) {
-
- r = path_is_config(paths, *p, false);
- if (r < 0)
- return r;
- if (r > 0)
+ if (path_equal_ptr(*p, paths->persistent_config))
same_name_link_config = true;
else {
r = path_is_runtime(paths, *p, false);