From: David Tardon Date: Mon, 20 Feb 2023 18:39:25 +0000 (+0100) Subject: systemctl: use table_add_triggered X-Git-Tag: v254-rc1~1202^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4384e199d6e8b15e9bec8aa91a3ff9c687c0c79;p=thirdparty%2Fsystemd.git systemctl: use table_add_triggered --- diff --git a/src/systemctl/systemctl-list-units.c b/src/systemctl/systemctl-list-units.c index 3d37465661b..a678ebe7fca 100644 --- a/src/systemctl/systemctl-list-units.c +++ b/src/systemctl/systemctl-list-units.c @@ -621,7 +621,7 @@ static int output_timers_list(struct timer_info *timer_infos, size_t n) { table_set_ersatz_string(table, TABLE_ERSATZ_DASH); for (struct timer_info *t = timer_infos; t < timer_infos + n; t++) { - _cleanup_free_ char *j = NULL, *activates = NULL; + _cleanup_free_ char *j = NULL; const char *unit; if (t->machine) { @@ -632,17 +632,16 @@ static int output_timers_list(struct timer_info *timer_infos, size_t n) { } else unit = t->id; - activates = strv_join(t->triggered, ", "); - if (!activates) - return log_oom(); - r = table_add_many(table, TABLE_TIMESTAMP, t->next_elapse, TABLE_TIMESTAMP_RELATIVE, t->next_elapse, TABLE_TIMESTAMP, t->last_trigger, TABLE_TIMESTAMP_RELATIVE, t->last_trigger, - TABLE_STRING, unit, - TABLE_STRING, activates); + TABLE_STRING, unit); + if (r < 0) + return table_log_add_error(r); + + r = table_add_triggered(table, t->triggered); if (r < 0) return table_log_add_error(r); }