From: PavlNekrasov <95914807+PavlNekrasov@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:17:21 +0000 (+0300) Subject: Use correct error code in log message in output_waiting_jobs (#34404) X-Git-Tag: v257-rc1~420 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d80a9042cada88bc2ad2726de104292b2fd7ce57;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/systemctl/systemctl-list-jobs.c b/src/systemctl/systemctl-list-jobs.c index 2fecf613179..44054fda007 100644 --- a/src/systemctl/systemctl-list-jobs.c +++ b/src/systemctl/systemctl-list-jobs.c @@ -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); }