summaryrefslogtreecommitdiffstats
path: root/src/systemctl/systemctl-list-units.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemctl/systemctl-list-units.c')
-rw-r--r--src/systemctl/systemctl-list-units.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/systemctl/systemctl-list-units.c b/src/systemctl/systemctl-list-units.c
index 93dd4b7dfd..131553d96e 100644
--- a/src/systemctl/systemctl-list-units.c
+++ b/src/systemctl/systemctl-list-units.c
@@ -855,9 +855,18 @@ static int output_automounts_list(struct automount_info *infos, size_t n_infos)
r = table_add_many(table,
TABLE_STRING, info->what,
TABLE_STRING, info->where,
- TABLE_BOOLEAN, info->mounted,
- TABLE_TIMESPAN_MSEC, info->timeout_idle_usec,
- TABLE_STRING, unit);
+ TABLE_BOOLEAN, info->mounted);
+ if (r < 0)
+ return table_log_add_error(r);
+
+ if (timestamp_is_set(info->timeout_idle_usec))
+ r = table_add_cell(table, NULL, TABLE_TIMESPAN_MSEC, &info->timeout_idle_usec);
+ else
+ r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
+ if (r < 0)
+ return table_log_add_error(r);
+
+ r = table_add_cell(table, NULL, TABLE_STRING, unit);
if (r < 0)
return table_log_add_error(r);
}