summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfangxiuning <fangxiuning123@126.com>2020-07-06 21:32:22 +0800
committerfangxiuning <fangxiuning123@126.com>2020-07-06 21:32:22 +0800
commitf987a261b460bfdaaa6f5375a7e277772d4096cd (patch)
tree99704d7566e6b2c483d12c05d9c09b6d327ff75b
parenta64911f9b77457dfc09829d96e5fd1324c64c851 (diff)
downloadsystemd-f987a261b460bfdaaa6f5375a7e277772d4096cd.tar.gz
userdbctl homectl use table_log_add_error()
Signed-off-by: fangxiuning <fangxiuning123@126.com>
-rw-r--r--src/home/homectl.c6
-rw-r--r--src/partition/repart.c4
-rw-r--r--src/userdb/userdbctl.c8
3 files changed, 9 insertions, 9 deletions
diff --git a/src/home/homectl.c b/src/home/homectl.c
index 74c967eb26..149f960f76 100644
--- a/src/home/homectl.c
+++ b/src/home/homectl.c
@@ -142,12 +142,12 @@ static int list_homes(int argc, char *argv[], void *userdata) {
TABLE_UID, uid,
TABLE_GID, gid);
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
r = table_add_cell(table, &cell, TABLE_STRING, state);
if (r < 0)
- return log_error_errno(r, "Failed to add field to table: %m");
+ return table_log_add_error(r);
color = user_record_state_color(state);
if (color)
@@ -158,7 +158,7 @@ static int list_homes(int argc, char *argv[], void *userdata) {
TABLE_STRING, home,
TABLE_STRING, strna(empty_to_null(shell)));
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
}
r = sd_bus_message_exit_container(reply);
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 6da00be2ab..3080521279 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -1666,7 +1666,7 @@ static int context_dump_partitions(Context *context, const char *node) {
TABLE_UINT64, p->new_padding,
TABLE_STRING, padding_change, TABLE_SET_COLOR, !p->partitions_next && sum_padding > 0 ? ansi_underline() : NULL);
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
}
if (sum_padding > 0 || sum_size > 0) {
@@ -1689,7 +1689,7 @@ static int context_dump_partitions(Context *context, const char *node) {
TABLE_EMPTY,
TABLE_STRING, b);
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
}
r = table_print(t, stdout);
diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c
index 648eacd023..382a1cc9e4 100644
--- a/src/userdb/userdbctl.c
+++ b/src/userdb/userdbctl.c
@@ -85,7 +85,7 @@ static int show_user(UserRecord *ur, Table *table) {
TABLE_STRING, user_record_shell(ur),
TABLE_INT, (int) user_record_disposition(ur));
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
break;
@@ -234,7 +234,7 @@ static int show_group(GroupRecord *gr, Table *table) {
TABLE_GID, gr->gid,
TABLE_INT, (int) group_record_disposition(gr));
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
break;
@@ -377,7 +377,7 @@ static int show_membership(const char *user, const char *group, Table *table) {
TABLE_STRING, user,
TABLE_STRING, group);
if (r < 0)
- return log_error_errno(r, "Failed to add row to table: %m");
+ return table_log_add_error(r);
break;
@@ -521,7 +521,7 @@ static int display_services(int argc, char *argv[], void *userdata) {
TABLE_STRING, no ?: "yes",
TABLE_SET_COLOR, no ? ansi_highlight_red() : ansi_highlight_green());
if (r < 0)
- return log_error_errno(r, "Failed to add table row: %m");
+ return table_log_add_error(r);
}
if (table_get_rows(t) <= 0) {