1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

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 13:17:21 +03:00 committed by GitHub
parent a7afe5a3e7
commit d80a9042ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);
}