mirror of
https://github.com/systemd/systemd.git
synced 2026-08-12 22:17:19 +00:00
coredumpctl: call all verb functions verb_*
This commit is contained in:
committed by
Luca Boccassi
parent
e6ec16dbe2
commit
f5f1bc36d0
@@ -175,7 +175,7 @@ static int acquire_journal(sd_journal **ret, char **matches) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int verb_help(int argc, char **argv, void *userdata) {
|
||||
static int help(void) {
|
||||
_cleanup_free_ char *link = NULL;
|
||||
int r;
|
||||
|
||||
@@ -223,6 +223,10 @@ static int verb_help(int argc, char **argv, void *userdata) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int verb_help(int argc, char *argv[], void *userdata) {
|
||||
return help();
|
||||
}
|
||||
|
||||
static int parse_argv(int argc, char *argv[]) {
|
||||
enum {
|
||||
ARG_VERSION = 0x100,
|
||||
@@ -889,7 +893,7 @@ static int print_entry(
|
||||
return print_info(stdout, j, n_found > 0);
|
||||
}
|
||||
|
||||
static int dump_list(int argc, char **argv, void *userdata) {
|
||||
static int verb_dump_list(int argc, char **argv, void *userdata) {
|
||||
_cleanup_(sd_journal_closep) sd_journal *j = NULL;
|
||||
_cleanup_(table_unrefp) Table *t = NULL;
|
||||
size_t n_found = 0;
|
||||
@@ -1140,7 +1144,7 @@ error:
|
||||
return r;
|
||||
}
|
||||
|
||||
static int dump_core(int argc, char **argv, void *userdata) {
|
||||
static int verb_dump_core(int argc, char **argv, void *userdata) {
|
||||
_cleanup_(sd_journal_closep) sd_journal *j = NULL;
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
int r;
|
||||
@@ -1176,7 +1180,7 @@ static int dump_core(int argc, char **argv, void *userdata) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int run_debug(int argc, char **argv, void *userdata) {
|
||||
static int verb_run_debug(int argc, char **argv, void *userdata) {
|
||||
static const struct sigaction sa = {
|
||||
.sa_sigaction = sigterm_process_group_handler,
|
||||
.sa_flags = SA_SIGINFO,
|
||||
@@ -1369,12 +1373,12 @@ static int check_units_active(void) {
|
||||
static int coredumpctl_main(int argc, char *argv[]) {
|
||||
|
||||
static const Verb verbs[] = {
|
||||
{ "list", VERB_ANY, VERB_ANY, VERB_DEFAULT, dump_list },
|
||||
{ "info", VERB_ANY, VERB_ANY, 0, dump_list },
|
||||
{ "dump", VERB_ANY, VERB_ANY, 0, dump_core },
|
||||
{ "debug", VERB_ANY, VERB_ANY, 0, run_debug },
|
||||
{ "gdb", VERB_ANY, VERB_ANY, 0, run_debug },
|
||||
{ "help", VERB_ANY, 1, 0, verb_help },
|
||||
{ "list", VERB_ANY, VERB_ANY, VERB_DEFAULT, verb_dump_list },
|
||||
{ "info", VERB_ANY, VERB_ANY, 0, verb_dump_list },
|
||||
{ "dump", VERB_ANY, VERB_ANY, 0, verb_dump_core },
|
||||
{ "debug", VERB_ANY, VERB_ANY, 0, verb_run_debug },
|
||||
{ "gdb", VERB_ANY, VERB_ANY, 0, verb_run_debug },
|
||||
{ "help", VERB_ANY, 1, 0, verb_help },
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user