summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-24 11:54:15 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:55:51 +0200
commit4f16c1f479ac3d790933ca196075cba333bab387 (patch)
tree7085c01c2ed18914c420e49f6c8c8022c412aed3 /src
parentf2d11d35e90d5143d2bc6103ff451778909644f0 (diff)
systemctl: don't special case ACTION_RUNLEVEL anymore
Let's move its dispatching to the main switch statement.
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 4de01d91d1..fe71d059fc 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -266,6 +266,11 @@ static void warn_wall(enum action a) {
static bool avoid_bus(void) {
+ /* /sbin/runlevel doesn't need to communicate via D-Bus, so
+ * let's shortcut this */
+ if (arg_action == ACTION_RUNLEVEL)
+ return true;
+
if (running_in_chroot() > 0)
return true;
@@ -7574,13 +7579,6 @@ int main(int argc, char*argv[]) {
if (r <= 0)
goto finish;
- /* /sbin/runlevel doesn't need to communicate via D-Bus, so
- * let's shortcut this */
- if (arg_action == ACTION_RUNLEVEL) {
- r = runlevel_main();
- goto finish;
- }
-
if (running_in_chroot() > 0 && arg_action != ACTION_SYSTEMCTL) {
log_info("Running in chroot, ignoring request.");
r = 0;
@@ -7654,6 +7652,9 @@ int main(int argc, char*argv[]) {
}
case ACTION_RUNLEVEL:
+ r = runlevel_main();
+ break;
+
case _ACTION_INVALID:
default:
assert_not_reached("Unknown action");