diff options
author | PavlNekrasov <95914807+PavlNekrasov@users.noreply.github.com> | 2024-09-17 12:17:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-17 12:17:21 +0200 |
commit | d80a9042cada88bc2ad2726de104292b2fd7ce57 (patch) | |
tree | 3443c85b1f2d251bb89ccdbbba4fe6c9bf4f020f /src/systemctl | |
parent | Merge pull request #34443 from yuwata/network-sysctl-monitor-follow-ups (diff) | |
download | systemd-d80a9042cada88bc2ad2726de104292b2fd7ce57.tar.xz systemd-d80a9042cada88bc2ad2726de104292b2fd7ce57.zip |
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.
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl-list-jobs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/systemctl/systemctl-list-jobs.c b/src/systemctl/systemctl-list-jobs.c index 2fecf61317..44054fda00 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); } |