From a174da59c299f6197425707f23757dc9149e5fba Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 Mar 2021 16:41:35 +0100 Subject: [PATCH] coredump: omit coredump info when -q is used with the `debug` verb Skip printing the coredump info table when using the `debug` verb in combination with the `-q/--quiet` option. Useful when trying to gather coredump info non-interactively via scripted gdb commands. Fixes: systemd/systemd#18935 --- src/coredump/coredumpctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 9b09f86989..e1042d9bc4 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -1078,8 +1078,10 @@ static int run_debug(int argc, char **argv, void *userdata) { if (r < 0) return r; - print_info(stdout, j, false); - fputs("\n", stdout); + if (!arg_quiet) { + print_info(stdout, j, false); + fputs("\n", stdout); + } r = sd_journal_get_data(j, "COREDUMP_EXE", (const void**) &data, &len); if (r < 0)