From: Christian Hesse Date: Wed, 17 Oct 2012 14:03:49 +0000 (+0200) Subject: systemctl: fix return code in chroot X-Git-Tag: v195~31 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=df77cdf0fccadbb5989042d43cde2f88aa9afd2c;ds=sidebyside systemctl: fix return code in chroot If 'systemctl enable' (and friends) is run inside chroot it always exits with a bad return code. unit_file_enable() returns the number of symlink rules that were supposed to be created. So resetting r to 0 and exiting gracefully should be the correct way. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index bb7213354..b4b58c05b 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3630,6 +3630,7 @@ static int enable_unit(DBusConnection *bus, char **args) { } } + r = 0; } else { const char *method; bool send_force = true, expect_carries_install_info = false;