_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_free_ char *cgroup = NULL;
- unsigned c;
int r;
assert(bus);
if (isempty(cgroup))
return 0;
- c = columns();
- if (c > 18)
- c -= 18;
-
+ unsigned c = MAX(LESS_BY(columns(), 18U), 10U);
r = unit_show_processes(bus, unit, cgroup, prefix, c, get_output_flags(), &error);
if (r == -EBADR) {
if (arg_transport == BUS_TRANSPORT_REMOTE)
return table_log_print_error(r);
if (arg_transport == BUS_TRANSPORT_LOCAL) {
- unsigned c = columns();
- if (c > 21)
- c -= 21;
-
+ unsigned c = MAX(LESS_BY(columns(), 21U), 10U);
show_sysfs(i.id, strrepa(" ", STRLEN("Sessions:")), c, get_output_flags());
}
_cleanup_free_ char *cgroup = NULL;
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
int r;
- unsigned c;
assert(bus);
assert(unit);
if (isempty(cgroup))
return 0;
- c = columns();
- if (c > 18)
- c -= 18;
- else
- c = 0;
-
+ unsigned c = MAX(LESS_BY(columns(), 18U), 10U);
r = unit_show_processes(bus, unit, cgroup, "\t\t ", c, get_output_flags(), &error);
if (r == -EBADR) {