summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-11-22 15:45:34 -0500
committerMichal Schmidt <mschmidt@redhat.com>2011-12-05 22:04:42 +0100
commitd380a3bcd14376ed72286e78dbcc871b7d6d2151 (patch)
tree095eb202adbbd0a65957fbf3122673f1278bdccb /src/install.c
parent2096e009a790073a934f5cd07d17024d3b199d0b (diff)
Allow 'list-unit-files' to run with --root.
To do so, move the check for the bus to the bus-using portion of list_unit_files(), and ensure that get_config_path doesn't abort when checking the runtime path with --root.
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/install.c b/src/install.c
index cfbd50ead9..1fb1f9d580 100644
--- a/src/install.c
+++ b/src/install.c
@@ -72,9 +72,8 @@ static int get_config_path(UnitFileScope scope, bool runtime, const char *root_d
case UNIT_FILE_SYSTEM:
if (root_dir && runtime)
- return -EINVAL;
-
- if (runtime)
+ asprintf(&p, "%s/run/systemd/system", root_dir);
+ else if (runtime)
p = strdup("/run/systemd/system");
else if (root_dir)
asprintf(&p, "%s/%s", root_dir, SYSTEM_CONFIG_UNIT_PATH);