tree-wide: avoid logging 2 error messages if table_print_with_pager() fails
`table_print_with_pager()` already calls `table_log_print_error()` internally if there is an error.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user