1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00

table add table_log_show_error()

This commit is contained in:
fangxiuning 2020-07-07 10:13:13 +08:00
parent f987a261b4
commit d836018a73
10 changed files with 17 additions and 14 deletions

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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
return 0;
}

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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
}
if (arg_legend && !arg_json) {

View File

@ -138,7 +138,7 @@ static int print_inhibitors(sd_bus *bus) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
}
if (arg_legend) {

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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
}
if (arg_legend) {

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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
}
if (arg_legend) {

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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
}
if (arg_legend) {

View File

@ -130,3 +130,6 @@ 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")

View File

@ -392,7 +392,7 @@ static int output_table(Table *table) {
else
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
return 0;
}

View File

@ -160,7 +160,7 @@ static int print_status_info(const StatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
return log_error_errno(r, "Failed to show table: %m");
return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
return 0;
}
@ -526,7 +526,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
log_error_errno(r, "Failed to show table: %m");
table_log_show_error(r);
return 0;
}

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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
return table_log_show_error(r);
}
return ret;