diff options
-rw-r--r-- | man/coredumpctl.xml | 5 | ||||
-rw-r--r-- | src/coredump/coredumpctl.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/man/coredumpctl.xml b/man/coredumpctl.xml index 6db9bca068..6179d6b760 100644 --- a/man/coredumpctl.xml +++ b/man/coredumpctl.xml @@ -389,7 +389,10 @@ <refsect1> <title>Exit status</title> - <para>On success, 0 is returned; otherwise, a non-zero failure code is returned.</para> + <para>On success, 0 is returned; otherwise, a non-zero failure + code is returned. Not finding any matching core dumps is treated as + failure. + </para> </refsect1> <refsect1> diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 4a25a2fb70..e7d0dd34c0 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; } } |