From 9e710d2665079401e16e74f3366355cdc91ff282 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 24 Dec 2023 04:26:16 +0800 Subject: [PATCH 1/2] analyze-fdstore: ignore table header when checking stored fd count --- src/analyze/analyze-fdstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyze/analyze-fdstore.c b/src/analyze/analyze-fdstore.c index 13db7f5088..9881520242 100644 --- a/src/analyze/analyze-fdstore.c +++ b/src/analyze/analyze-fdstore.c @@ -81,7 +81,7 @@ static int dump_fdstore(sd_bus *bus, const char *arg) { if (r < 0) return r; - if (FLAGS_SET(arg_json_format_flags, JSON_FORMAT_OFF) && table_get_rows(table) <= 0) + if (FLAGS_SET(arg_json_format_flags, JSON_FORMAT_OFF) && table_get_rows(table) <= 1) log_info("No file descriptors in fdstore of '%s'.", unit); else { r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */true); From c6195c96677471f772c43a8661bc3fc69041c505 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 24 Dec 2023 04:25:03 +0800 Subject: [PATCH 2/2] analyze-fdstore: don't log duplicate error table_print_with_pager() logs print error internally. --- src/analyze/analyze-fdstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyze/analyze-fdstore.c b/src/analyze/analyze-fdstore.c index 9881520242..e1f88c3552 100644 --- a/src/analyze/analyze-fdstore.c +++ b/src/analyze/analyze-fdstore.c @@ -86,7 +86,7 @@ static int dump_fdstore(sd_bus *bus, const char *arg) { else { r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */true); if (r < 0) - return log_error_errno(r, "Failed to output table: %m"); + return r; } return EXIT_SUCCESS;