From: Yu Watanabe Date: Wed, 11 Dec 2024 01:54:20 +0000 (+0900) Subject: Revert "coredumpctl: Don't treat no coredumps as failure" X-Git-Tag: v258-rc1~1922 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77064620d70ecdd3d4f574fc57fec5debd5b6841;p=thirdparty%2Fsystemd.git Revert "coredumpctl: Don't treat no coredumps as failure" This reverts commit dfe79b9ed21b0feeb5a120e8b994f46cff7cf5b0. --- diff --git a/man/coredumpctl.xml b/man/coredumpctl.xml index 6db9bca0681..6179d6b760d 100644 --- a/man/coredumpctl.xml +++ b/man/coredumpctl.xml @@ -389,7 +389,10 @@ Exit status - On success, 0 is returned; otherwise, a non-zero failure code is returned. + On success, 0 is returned; otherwise, a non-zero failure + code is returned. Not finding any matching core dumps is treated as + failure. + diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 4a25a2fb703..e7d0dd34c0d 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -963,10 +963,9 @@ static int dump_list(int argc, char **argv, void *userdata) { } if (!arg_field && n_found <= 0) { - if (!arg_quiet && !sd_json_format_enabled(arg_json_format_flags)) + if (!arg_quiet) log_notice("No coredumps found."); - - return 0; + return -ESRCH; } }