if (cs) {
for (s = socket_infos; s < socket_infos + cs; s++) {
- _cleanup_free_ char *j = NULL, *activates = NULL;
+ _cleanup_free_ char *j = NULL;
const char *path;
if (s->machine) {
} else
path = s->path;
- activates = strv_join(s->triggered, ", ");
- if (!activates)
- return log_oom();
-
r = table_add_many(table,
TABLE_STRING, path,
TABLE_STRING, s->type,
- TABLE_STRING, s->id,
- TABLE_STRING, activates);
+ TABLE_STRING, s->id);
if (r < 0)
return table_log_add_error(r);
+
+ if (strv_isempty(s->triggered))
+ r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
+ else if (strv_length(s->triggered) == 1)
+ r = table_add_cell(table, NULL, TABLE_STRING, s->triggered[0]);
+ else
+ /* This should never happen, currently our socket units can only trigger a
+ * single unit. But let's handle this anyway, who knows what the future
+ * brings? */
+ r = table_add_cell(table, NULL, TABLE_STRV, s->triggered);
+ if (r < 0)
+ return table_log_add_error(r);
+
}
on = ansi_highlight();