]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: avoid logging 2 error messages if table_print_with_pager() fails 38753/head
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 28 Aug 2025 12:09:50 +0000 (14:09 +0200)
committerAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 28 Aug 2025 12:09:50 +0000 (14:09 +0200)
`table_print_with_pager()` already calls `table_log_print_error()` internally if
there is an error.

src/analyze/analyze-architectures.c
src/analyze/analyze-capability.c
src/analyze/analyze-chid.c
src/analyze/analyze-exit-status.c
src/analyze/analyze-pcrs.c
src/analyze/analyze-security.c
src/import/importctl.c
src/journal/journalctl-misc.c
src/pcrlock/pcrlock.c
src/userdb/userdbctl.c

index a884060938b2797c2b9284d3fa9659797cde7714..de9b899f12f37286fa9b41f44da1d9a8fafa3abe 100644 (file)
@@ -87,7 +87,7 @@ int verb_architectures(int argc, char *argv[], void *userdata) {
 
         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
         if (r < 0)
-                return log_error_errno(r, "Failed to output table: %m");
+                return r;
 
         return EXIT_SUCCESS;
 }
index 7fe7ff25e5b96683d683fec3a9fae4b41302d517..57bb67ace997f9bc7450b36cf0e5eccc6227d655 100644 (file)
@@ -82,7 +82,7 @@ int verb_capabilities(int argc, char *argv[], void *userdata) {
 
         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
         if (r < 0)
-                return log_error_errno(r, "Failed to output table: %m");
+                return r;
 
         return 0;
 }
index ac3c4d9cb6da2e220666e1294dc54bf42d86aced..cf9f0daae5238e1c78d0f01a66383ef110dca0b4 100644 (file)
@@ -405,7 +405,7 @@ int verb_chid(int argc, char *argv[], void *userdata) {
 
         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
         if (r < 0)
-                return log_error_errno(r, "Failed to output table: %m");
+                return r;
 
         if (!sd_json_format_enabled(arg_json_format_flags)) {
                 _cleanup_free_ char *legend = NULL;
index 4876189be9f55070f493ffc8bb3b09860daeea13..8b506848546723ad37285fc980dde81c59ae3234 100644 (file)
@@ -51,7 +51,7 @@ int verb_exit_status(int argc, char *argv[], void *userdata) {
 
         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
         if (r < 0)
-                return log_error_errno(r, "Failed to output table: %m");
+                return r;
 
         return 0;
 }
index 680f67540a71d0ed475ea98233f13d809f697291..aa26af275d27f99ffa5a33781da2f5f35869b62d 100644 (file)
@@ -143,7 +143,7 @@ int verb_pcrs(int argc, char *argv[], void *userdata) {
 
         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;
 }
index ba544ba1e5b904b75caf8f01974ebbb5aa964b36..bdb06dd682c111d7c8903702d3323b4c72f50cc2 100644 (file)
@@ -1878,7 +1878,7 @@ static int assess(const SecurityInfo *info,
 
                 r = table_print_with_pager(details_table, json_format_flags, pager_flags, /* show_header= */true);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to output table: %m");
+                        return r;
         }
 
         exposure = DIV_ROUND_UP(badness_sum * 100U, weight_sum);
@@ -2889,7 +2889,7 @@ static int analyze_security(sd_bus *bus,
 
                 r = table_print_with_pager(overview_table, json_format_flags, pager_flags, /* show_header= */true);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to output table: %m");
+                        return r;
         }
         return ret;
 }
index 5f3a04a7529c015f661db337a0670a9b1bc7af14..e5f004e1572646364fe411133133efae154a7dee 100644 (file)
@@ -851,7 +851,7 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
         if (!table_isempty(t)) {
                 r = table_print_with_pager(t, arg_json_format_flags, arg_pager_flags, arg_legend);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to output table: %m");
+                        return r;
         }
 
         if (arg_legend) {
@@ -970,7 +970,7 @@ static int list_images(int argc, char *argv[], void *userdata) {
         if (!table_isempty(t)) {
                 r = table_print_with_pager(t, arg_json_format_flags, arg_pager_flags, arg_legend);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to output table: %m");
+                        return r;
         }
 
         if (arg_legend) {
index c69ddd4985fa2ea3a8f17cb41472ce249fddb37c..e7c861b6b28bd5987e2855b4f83f18280f5737e6 100644 (file)
@@ -153,7 +153,7 @@ static int show_log_ids(const LogId *ids, size_t n_ids, const char *name) {
 
         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, !arg_quiet);
         if (r < 0)
-                return table_log_print_error(r);
+                return r;
 
         return 0;
 }
index 8ab089e609832af2153d9c81ab51c779d708a54a..a04bb8c93c5bbd274aca3815d000a03d45cd12a5 100644 (file)
@@ -2192,7 +2192,7 @@ static int show_log_table(EventLog *el, sd_json_variant **ret_variant) {
 
         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 0;
 }
@@ -2353,7 +2353,7 @@ static int show_pcr_table(EventLog *el, sd_json_variant **ret_variant) {
 
         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;
 
         if (!sd_json_format_enabled(arg_json_format_flags))
                 printf("\n"
@@ -2664,7 +2664,7 @@ static int verb_list_components(int argc, char *argv[], void *userdata) {
         if (!table_isempty(table) || sd_json_format_enabled(arg_json_format_flags)) {
                 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;
         }
 
         if (!sd_json_format_enabled(arg_json_format_flags)) {
index 285b3565fab806e14ca33a4312cca29424508e59..fb99ac971a0e3549d7d88c26af010eba65e39463 100644 (file)
@@ -526,7 +526,7 @@ static int display_user(int argc, char *argv[], void *userdata) {
                 if (!table_isempty(table)) {
                         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
                         if (r < 0)
-                                return table_log_print_error(r);
+                                return r;
                 }
 
                 if (arg_legend) {
@@ -865,7 +865,7 @@ static int display_group(int argc, char *argv[], void *userdata) {
                 if (!table_isempty(table)) {
                         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
                         if (r < 0)
-                                return table_log_print_error(r);
+                                return r;
                 }
 
                 if (arg_legend) {
@@ -1017,7 +1017,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
                 if (!table_isempty(table)) {
                         r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
                         if (r < 0)
-                                return table_log_print_error(r);
+                                return r;
                 }
 
                 if (arg_legend) {
@@ -1085,7 +1085,7 @@ static int display_services(int argc, char *argv[], void *userdata) {
         if (!table_isempty(t)) {
                 r = table_print_with_pager(t, arg_json_format_flags, arg_pager_flags, arg_legend);
                 if (r < 0)
-                        return table_log_print_error(r);
+                        return r;
         }
 
         if (arg_legend && arg_output != OUTPUT_JSON) {