tree-wide: use table_log_add_error()

This commit is contained in:
Yu Watanabe
2020-01-10 18:28:30 +09:00
parent 964a7745de
commit bd17fa8cd8
6 changed files with 96 additions and 87 deletions
+6 -6
View File
@@ -237,7 +237,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
TABLE_EMPTY,
TABLE_EMPTY);
if (r < 0)
return log_error_errno(r, "Failed to fill line: %m");
return table_log_add_error(r);
continue;
}
@@ -254,7 +254,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
TABLE_INT, PTR_TO_INT(v),
TABLE_STRING, k);
if (r < 0)
return log_error_errno(r, "Failed to add name %s to table: %m", k);
return table_log_add_error(r);
r = sd_bus_get_name_creds(
bus, k,
@@ -283,7 +283,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
} else
r = table_add_many(table, TABLE_EMPTY, TABLE_EMPTY);
if (r < 0)
return log_error_errno(r, "Failed to add fields to table: %m");
return table_log_add_error(r);
r = sd_bus_creds_get_euid(creds, &uid);
if (r >= 0) {
@@ -297,7 +297,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
} else
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return log_error_errno(r, "Failed to add field to table: %m");
return table_log_add_error(r);
(void) sd_bus_creds_get_unique_name(creds, &unique);
(void) sd_bus_creds_get_unit(creds, &unit);
@@ -312,7 +312,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
TABLE_STRING, cn);
}
if (r < 0)
return log_error_errno(r, "Failed to add fields to table: %m");
return table_log_add_error(r);
if (arg_show_machine) {
sd_id128_t mid;
@@ -325,7 +325,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
r = table_add_cell(table, NULL, TABLE_STRING, sd_id128_to_string(mid, m));
if (r < 0)
return log_error_errno(r, "Failed to add field to table: %m");
return table_log_add_error(r);
continue; /* line fully filled, no need to fill the remainder below */
}