X Tutup
Skip to content

Commit bd17fa8

Browse files
committed
tree-wide: use table_log_add_error()
1 parent 964a774 commit bd17fa8

File tree

6 files changed

+96
-87
lines changed

6 files changed

+96
-87
lines changed

src/busctl/busctl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
237237
TABLE_EMPTY,
238238
TABLE_EMPTY);
239239
if (r < 0)
240-
return log_error_errno(r, "Failed to fill line: %m");
240+
return table_log_add_error(r);
241241

242242
continue;
243243
}
@@ -254,7 +254,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
254254
TABLE_INT, PTR_TO_INT(v),
255255
TABLE_STRING, k);
256256
if (r < 0)
257-
return log_error_errno(r, "Failed to add name %s to table: %m", k);
257+
return table_log_add_error(r);
258258

259259
r = sd_bus_get_name_creds(
260260
bus, k,
@@ -283,7 +283,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
283283
} else
284284
r = table_add_many(table, TABLE_EMPTY, TABLE_EMPTY);
285285
if (r < 0)
286-
return log_error_errno(r, "Failed to add fields to table: %m");
286+
return table_log_add_error(r);
287287

288288
r = sd_bus_creds_get_euid(creds, &uid);
289289
if (r >= 0) {
@@ -297,7 +297,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
297297
} else
298298
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
299299
if (r < 0)
300-
return log_error_errno(r, "Failed to add field to table: %m");
300+
return table_log_add_error(r);
301301

302302
(void) sd_bus_creds_get_unique_name(creds, &unique);
303303
(void) sd_bus_creds_get_unit(creds, &unit);
@@ -312,7 +312,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
312312
TABLE_STRING, cn);
313313
}
314314
if (r < 0)
315-
return log_error_errno(r, "Failed to add fields to table: %m");
315+
return table_log_add_error(r);
316316

317317
if (arg_show_machine) {
318318
sd_id128_t mid;
@@ -325,7 +325,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
325325

326326
r = table_add_cell(table, NULL, TABLE_STRING, sd_id128_to_string(mid, m));
327327
if (r < 0)
328-
return log_error_errno(r, "Failed to add field to table: %m");
328+
return table_log_add_error(r);
329329

330330
continue; /* line fully filled, no need to fill the remainder below */
331331
}

src/login/inhibit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static int print_inhibitors(sd_bus *bus) {
122122
TABLE_STRING, why,
123123
TABLE_STRING, mode);
124124
if (r < 0)
125-
return log_error_errno(r, "Failed to add table row: %m");
125+
return table_log_add_error(r);
126126
}
127127

128128
r = sd_bus_message_exit_container(reply);

src/login/loginctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int list_sessions(int argc, char *argv[], void *userdata) {
189189
TABLE_STRING, seat,
190190
TABLE_STRING, strna(tty));
191191
if (r < 0)
192-
return log_error_errno(r, "Failed to add row to table: %m");
192+
return table_log_add_error(r);
193193
}
194194

195195
r = sd_bus_message_exit_container(reply);
@@ -246,7 +246,7 @@ static int list_users(int argc, char *argv[], void *userdata) {
246246
TABLE_UID, (uid_t) uid,
247247
TABLE_STRING, user);
248248
if (r < 0)
249-
return log_error_errno(r, "Failed to add row to table: %m");
249+
return table_log_add_error(r);
250250
}
251251

252252
r = sd_bus_message_exit_container(reply);
@@ -298,7 +298,7 @@ static int list_seats(int argc, char *argv[], void *userdata) {
298298

299299
r = table_add_cell(table, NULL, TABLE_STRING, seat);
300300
if (r < 0)
301-
return log_error_errno(r, "Failed to add row to table: %m");
301+
return table_log_add_error(r);
302302
}
303303

304304
r = sd_bus_message_exit_container(reply);

src/mount/mount-tool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ static int list_devices(void) {
14461446

14471447
r = table_add_cell(table, NULL, c == COLUMN_NODE ? TABLE_PATH : TABLE_STRING, strna(x));
14481448
if (r < 0)
1449-
return log_error_errno(r, "Failed to add cell: %m");
1449+
return table_log_add_error(r);
14501450
}
14511451
}
14521452

0 commit comments

Comments
 (0)
X Tutup