summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/systemctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 12264f8ba7..ab6d126a26 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -3662,12 +3662,15 @@ static int enable_unit(DBusConnection *bus, char **args) {
int r;
DBusError error;
- dbus_error_init(&error);
-
r = enable_sysv_units(args);
if (r < 0)
return r;
+ if (!args[1])
+ return 0;
+
+ dbus_error_init(&error);
+
if (!bus || avoid_bus()) {
if (streq(verb, "enable")) {
r = unit_file_enable(arg_scope, arg_runtime, arg_root, args+1, arg_force, &changes, &n_changes);