summaryrefslogtreecommitdiff
path: root/src/shared/install.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/install.c')
-rw-r--r--src/shared/install.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index 0fe1371129..03c7a9da2e 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -2044,6 +2044,12 @@ int unit_file_get_list(
if (root_dir && scope != UNIT_FILE_SYSTEM)
return -EINVAL;
+ if (root_dir) {
+ r = access(root_dir, F_OK);
+ if (r < 0)
+ return -errno;
+ }
+
r = lookup_paths_init_from_scope(&paths, scope, root_dir);
if (r < 0)
return r;