summaryrefslogtreecommitdiff
path: root/src/core/dbus-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-24 16:02:48 +0100
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:29 +0200
commit7bfe3d44d008f46d65ebdf5adc0c847b45fd4ab2 (patch)
treeeb9cc09f0cf1c6bddc4b33fe3272a4145d5c1012 /src/core/dbus-manager.c
parentf413930863ab3b98cb7bf9e761081b4e88a5d7d9 (diff)
core: when enabling a generated unit file, return a clean error
Let's be precise when the user tries to invoke an "enable" operation on a generated unit file.
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r--src/core/dbus-manager.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 739bd14b9e..e187e19d03 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1648,7 +1648,9 @@ static int method_enable_unit_files_generic(
r = call(scope, runtime, NULL, l, force, &changes, &n_changes);
if (r == -ESHUTDOWN)
- return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked");
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked.");
+ if (r == -EADDRNOTAVAIL)
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is generated.");
if (r < 0)
return r;
@@ -1886,7 +1888,9 @@ static int method_add_dependency_unit_files(sd_bus_message *message, void *userd
r = unit_file_add_dependency(scope, runtime, NULL, l, target, dep, force, &changes, &n_changes);
if (r == -ESHUTDOWN)
- return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked");
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked.");
+ if (r == -EADDRNOTAVAIL)
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is generated.");
if (r < 0)
return r;