]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: omit coredump info when -q is used with the `debug` verb
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 10 Mar 2021 15:41:35 +0000 (16:41 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Mar 2021 16:35:21 +0000 (17:35 +0100)
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

index 9b09f86989314ec09660bd79c0925cbf221c92a5..e1042d9bc4afa45f823c19bab25882fbb21fc0ec 100644 (file)
@@ -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)