systemctl: make sure daemon-reexec and friends return a correct error code

This commit is contained in:
Lennart Poettering 2010-09-01 02:11:52 +02:00
parent 706900b704
commit aabd9b11ba

View file

@ -2928,7 +2928,7 @@ static int daemon_reload(DBusConnection *bus, char **args, unsigned n) {
if (arg_action != ACTION_SYSTEMCTL && error_is_no_service(&error)) { if (arg_action != ACTION_SYSTEMCTL && error_is_no_service(&error)) {
/* There's always a fallback possible for /* There's always a fallback possible for
* legacy actions. */ * legacy actions. */
r = 0; r = -EADDRNOTAVAIL;
goto finish; goto finish;
} }
@ -2937,7 +2937,7 @@ static int daemon_reload(DBusConnection *bus, char **args, unsigned n) {
goto finish; goto finish;
} }
r = 1; r = 0;
finish: finish:
if (m) if (m)
@ -4605,7 +4605,7 @@ static int talk_upstart(void) {
if (!(reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error))) { if (!(reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error))) {
if (error_is_no_service(&error)) { if (error_is_no_service(&error)) {
r = 0; r = -EADDRNOTAVAIL;
goto finish; goto finish;
} }
@ -4614,7 +4614,7 @@ static int talk_upstart(void) {
goto finish; goto finish;
} }
r = 1; r = 0;
finish: finish:
if (m) if (m)