mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
systemctl: move unit action table closer to the functions that use them
All other static tables we placed next to the functions that access them, so let's do this for the unit action table too.
This commit is contained in:
parent
70ae006b43
commit
2fc9a280cc
@ -137,23 +137,6 @@ static unsigned arg_lines = 10;
|
||||
static OutputMode arg_output = OUTPUT_SHORT;
|
||||
static bool arg_plain = false;
|
||||
|
||||
static const struct {
|
||||
const char *verb;
|
||||
const char *method;
|
||||
} unit_actions[] = {
|
||||
{ "start", "StartUnit" },
|
||||
{ "stop", "StopUnit" },
|
||||
{ "condstop", "StopUnit" },
|
||||
{ "reload", "ReloadUnit" },
|
||||
{ "restart", "RestartUnit" },
|
||||
{ "try-restart", "TryRestartUnit" },
|
||||
{ "condrestart", "TryRestartUnit" },
|
||||
{ "reload-or-restart", "ReloadOrRestartUnit" },
|
||||
{ "reload-or-try-restart", "ReloadOrTryRestartUnit" },
|
||||
{ "condreload", "ReloadOrTryRestartUnit" },
|
||||
{ "force-reload", "ReloadOrTryRestartUnit" }
|
||||
};
|
||||
|
||||
static bool original_stdout_is_tty;
|
||||
|
||||
static int daemon_reload(sd_bus *bus, char **args);
|
||||
@ -2539,6 +2522,23 @@ static int check_triggering_units(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *verb;
|
||||
const char *method;
|
||||
} unit_actions[] = {
|
||||
{ "start", "StartUnit" },
|
||||
{ "stop", "StopUnit" },
|
||||
{ "condstop", "StopUnit" },
|
||||
{ "reload", "ReloadUnit" },
|
||||
{ "restart", "RestartUnit" },
|
||||
{ "try-restart", "TryRestartUnit" },
|
||||
{ "condrestart", "TryRestartUnit" },
|
||||
{ "reload-or-restart", "ReloadOrRestartUnit" },
|
||||
{ "reload-or-try-restart", "ReloadOrTryRestartUnit" },
|
||||
{ "condreload", "ReloadOrTryRestartUnit" },
|
||||
{ "force-reload", "ReloadOrTryRestartUnit" }
|
||||
};
|
||||
|
||||
static const char *verb_to_method(const char *verb) {
|
||||
uint i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user