table use table_log_print_error() instead of table_log_show_error

This commit is contained in:
fangxiuning
2020-07-08 15:16:52 +08:00
parent df83eb546b
commit 4b6607d949
14 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -371,7 +371,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
else
r = table_print(table, stdout);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
return 0;
}
+1 -1
View File
@@ -177,7 +177,7 @@ static int list_homes(int argc, char *argv[], void *userdata) {
else
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
if (arg_legend && !arg_json) {
+1 -1
View File
@@ -139,7 +139,7 @@ static int verb_show(int argc, char **argv, void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
}
return 0;
+1 -1
View File
@@ -138,7 +138,7 @@ static int print_inhibitors(sd_bus *bus) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
if (arg_legend) {
+1 -1
View File
@@ -100,7 +100,7 @@ static int show_table(Table *table, const char *word) {
else
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
if (arg_legend) {
+1 -1
View File
@@ -246,7 +246,7 @@ static int show_table(Table *table, const char *word) {
else
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
if (arg_legend) {
+1 -1
View File
@@ -1436,7 +1436,7 @@ static int list_devices(void) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
return 0;
}
+5 -5
View File
@@ -719,7 +719,7 @@ static int list_links(int argc, char *argv[], void *userdata) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
if (arg_legend)
printf("\n%i links listed.\n", c);
@@ -1064,7 +1064,7 @@ static int dump_address_labels(sd_netlink *rtnl) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
return 0;
}
@@ -2129,7 +2129,7 @@ static int link_status_one(
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
return show_logs(info);
}
@@ -2201,7 +2201,7 @@ static int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
return show_logs(NULL);
}
@@ -2421,7 +2421,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
if (arg_legend) {
lldp_capabilities_legend(all);
+1 -1
View File
@@ -750,7 +750,7 @@ static int list_images(int argc, char *argv[], void *userdata) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
if (arg_legend) {
+3 -3
View File
@@ -1079,7 +1079,7 @@ static int show_statistics(int argc, char **argv, void *userdata) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
return 0;
}
@@ -1519,7 +1519,7 @@ static int status_ifindex(sd_bus *bus, int ifindex, const char *name, StatusMode
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
if (empty_line)
*empty_line = true;
@@ -1760,7 +1760,7 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to print table: %m");
return table_log_print_error(r);
*empty_line = true;
+2 -2
View File
@@ -131,8 +131,8 @@ int table_print_json(Table *t, FILE *f, JsonFormatFlags json_flags);
#define table_log_add_error(r) \
log_error_errno(r, "Failed to add cell(s) to table: %m")
#define table_log_show_error(r) \
log_error_errno(r, "Failed to show table: %m")
#define table_log_print_error(r) \
log_error_errno(r, "Failed to print table: %m")
#define table_log_sort_error(r) \
log_error_errno(r, "Failed to sort table: %m")
+1 -1
View File
@@ -392,7 +392,7 @@ static int output_table(Table *table) {
else
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
return 0;
}
+4 -4
View File
@@ -160,7 +160,7 @@ static int print_status_info(const StatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
if (i->rtc_local)
printf("\n%s"
@@ -433,7 +433,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
return 0;
}
@@ -442,7 +442,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
log_error("Invalid NTP response");
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
return 0;
}
@@ -526,7 +526,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
table_log_show_error(r);
return table_log_print_error(r);
return 0;
}
+3 -3
View File
@@ -180,7 +180,7 @@ static int display_user(int argc, char *argv[], void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
return ret;
@@ -330,7 +330,7 @@ static int display_group(int argc, char *argv[], void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
return ret;
@@ -463,7 +463,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
return table_log_show_error(r);
return table_log_print_error(r);
}
return ret;