X Tutup
Skip to content

Commit f987a26

Browse files
committed
userdbctl homectl use table_log_add_error()
Signed-off-by: fangxiuning <fangxiuning123@126.com>
1 parent a64911f commit f987a26

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/home/homectl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ static int list_homes(int argc, char *argv[], void *userdata) {
142142
TABLE_UID, uid,
143143
TABLE_GID, gid);
144144
if (r < 0)
145-
return log_error_errno(r, "Failed to add row to table: %m");
145+
return table_log_add_error(r);
146146

147147

148148
r = table_add_cell(table, &cell, TABLE_STRING, state);
149149
if (r < 0)
150-
return log_error_errno(r, "Failed to add field to table: %m");
150+
return table_log_add_error(r);
151151

152152
color = user_record_state_color(state);
153153
if (color)
@@ -158,7 +158,7 @@ static int list_homes(int argc, char *argv[], void *userdata) {
158158
TABLE_STRING, home,
159159
TABLE_STRING, strna(empty_to_null(shell)));
160160
if (r < 0)
161-
return log_error_errno(r, "Failed to add row to table: %m");
161+
return table_log_add_error(r);
162162
}
163163

164164
r = sd_bus_message_exit_container(reply);

src/partition/repart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@ static int context_dump_partitions(Context *context, const char *node) {
16661666
TABLE_UINT64, p->new_padding,
16671667
TABLE_STRING, padding_change, TABLE_SET_COLOR, !p->partitions_next && sum_padding > 0 ? ansi_underline() : NULL);
16681668
if (r < 0)
1669-
return log_error_errno(r, "Failed to add row to table: %m");
1669+
return table_log_add_error(r);
16701670
}
16711671

16721672
if (sum_padding > 0 || sum_size > 0) {
@@ -1689,7 +1689,7 @@ static int context_dump_partitions(Context *context, const char *node) {
16891689
TABLE_EMPTY,
16901690
TABLE_STRING, b);
16911691
if (r < 0)
1692-
return log_error_errno(r, "Failed to add row to table: %m");
1692+
return table_log_add_error(r);
16931693
}
16941694

16951695
r = table_print(t, stdout);

src/userdb/userdbctl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int show_user(UserRecord *ur, Table *table) {
8585
TABLE_STRING, user_record_shell(ur),
8686
TABLE_INT, (int) user_record_disposition(ur));
8787
if (r < 0)
88-
return log_error_errno(r, "Failed to add row to table: %m");
88+
return table_log_add_error(r);
8989

9090
break;
9191

@@ -234,7 +234,7 @@ static int show_group(GroupRecord *gr, Table *table) {
234234
TABLE_GID, gr->gid,
235235
TABLE_INT, (int) group_record_disposition(gr));
236236
if (r < 0)
237-
return log_error_errno(r, "Failed to add row to table: %m");
237+
return table_log_add_error(r);
238238

239239
break;
240240

@@ -377,7 +377,7 @@ static int show_membership(const char *user, const char *group, Table *table) {
377377
TABLE_STRING, user,
378378
TABLE_STRING, group);
379379
if (r < 0)
380-
return log_error_errno(r, "Failed to add row to table: %m");
380+
return table_log_add_error(r);
381381

382382
break;
383383

@@ -521,7 +521,7 @@ static int display_services(int argc, char *argv[], void *userdata) {
521521
TABLE_STRING, no ?: "yes",
522522
TABLE_SET_COLOR, no ? ansi_highlight_red() : ansi_highlight_green());
523523
if (r < 0)
524-
return log_error_errno(r, "Failed to add table row: %m");
524+
return table_log_add_error(r);
525525
}
526526

527527
if (table_get_rows(t) <= 0) {

0 commit comments

Comments
 (0)
X Tutup