mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 08:26:52 +03:00
systemctl: fix exit code when directing is-enabled to chkconfig
This commit is contained in:
parent
81ab0d3c65
commit
63a723f3a7
@ -4087,10 +4087,15 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (status.si_code == CLD_EXITED) {
|
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 ++;
|
n_symlinks ++;
|
||||||
|
|
||||||
return status.si_status == 0 ? 0 : -EINVAL;
|
return status.si_status == 0 ? 0 : -EINVAL;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return -EPROTO;
|
return -EPROTO;
|
||||||
}
|
}
|
||||||
@ -4193,6 +4198,8 @@ static int enable_unit(DBusConnection *bus, char **args, unsigned n) {
|
|||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = 0;
|
||||||
|
|
||||||
while ((i = hashmap_first(will_install))) {
|
while ((i = hashmap_first(will_install))) {
|
||||||
int q;
|
int q;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user