From: Daan De Meyer Date: Sat, 23 Nov 2024 11:14:06 +0000 (+0100) Subject: coredumpctl: Don't treat no coredumps as failure X-Git-Tag: v258-rc1~1926 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfe79b9ed21b0feeb5a120e8b994f46cff7cf5b0;p=thirdparty%2Fsystemd.git coredumpctl: Don't treat no coredumps as failure Having to deal with a process that fails or doesn't fail depending on whether there are coredumps or not is incredibly annoying for users. --- diff --git a/man/coredumpctl.xml b/man/coredumpctl.xml index 6179d6b760d..6db9bca0681 100644 --- a/man/coredumpctl.xml +++ b/man/coredumpctl.xml @@ -389,10 +389,7 @@ Exit status - On success, 0 is returned; otherwise, a non-zero failure - code is returned. Not finding any matching core dumps is treated as - failure. - + On success, 0 is returned; otherwise, a non-zero failure code is returned. diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index e7d0dd34c0d..4a25a2fb703 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -963,9 +963,10 @@ static int dump_list(int argc, char **argv, void *userdata) { } if (!arg_field && n_found <= 0) { - if (!arg_quiet) + if (!arg_quiet && !sd_json_format_enabled(arg_json_format_flags)) log_notice("No coredumps found."); - return -ESRCH; + + return 0; } }