Use correct error code in log message in output_waiting_jobs (#34404)

The error code `r` from the read function is being logged, but the error code `rc` from the table data insertion function should be logged instead.
This commit is contained in:
PavlNekrasov
2024-09-17 19:17:21 +09:00
committed by GitHub
parent a7afe5a3e7
commit d80a9042ca
+2 -3
View File
@@ -28,17 +28,16 @@ static int output_waiting_jobs(sd_bus *bus, Table *table, uint32_t id, const cha
while ((r = sd_bus_message_read(reply, "(usssoo)", &other_id, &name, &type, NULL, NULL, NULL)) > 0) {
_cleanup_free_ char *row = NULL;
int rc;
if (asprintf(&row, "%s %u (%s/%s)", prefix, other_id, name, type) < 0)
return log_oom();
rc = table_add_many(table,
r = table_add_many(table,
TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
TABLE_STRING, row,
TABLE_EMPTY,
TABLE_EMPTY);
if (rc < 0)
if (r < 0)
return table_log_add_error(r);
}