chiark / gitweb /
systemctl: fix return code in chroot
authorChristian Hesse <list@eworm.de>
Wed, 17 Oct 2012 14:03:49 +0000 (16:03 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Oct 2012 15:34:02 +0000 (17:34 +0200)
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.

src/systemctl/systemctl.c

index bb7213354d13d9abf0d30137d4203fbdbe05a76c..b4b58c05b0a77192b569ee91d8fb16833eb0b167 100644 (file)
@@ -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;
         } else {
                 const char *method;
                 bool send_force = true, expect_carries_install_info = false;