summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-04 19:48:38 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-04 19:48:38 +0100
commit63a723f3a7caf4eb1bc46a3849f59f27337924b7 (patch)
tree43b8361e5860fecd57d33721b858dac5b146c27d /src
parent81ab0d3c65206140fffafefa6d14e8494edc44cb (diff)
systemctl: fix exit code when directing is-enabled to chkconfig
Diffstat (limited to 'src')
-rw-r--r--src/systemctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index b733b47c84..6adcbcc066 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4087,10 +4087,15 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
return r;
if (status.si_code == CLD_EXITED) {
- if (status.si_status == 0 && (streq(verb, "enable") || streq(verb, "disable")))
+
+ if (streq(verb, "is-enabled"))
+ return status.si_status == 0 ? 1 : 0;
+
+ if (status.si_status == 0)
n_symlinks ++;
return status.si_status == 0 ? 0 : -EINVAL;
+
} else
return -EPROTO;
}
@@ -4193,6 +4198,8 @@ static int enable_unit(DBusConnection *bus, char **args, unsigned n) {
goto finish;
}
+ r = 0;
+
while ((i = hashmap_first(will_install))) {
int q;