Changes from previous version:
* put the return value check to separate subpackages
* change the test (info.hierarchy == hierarchy) to
(info.hierarchy != hierarchy) to decrease the nesting depth
* use memset
This patch fixes lssubsys output - it fixes two problems:
1/ if there was subsystem attached to not-mounted hierarchy then
lssubsys -a
does not show this subsystems
EXAMPLE:
FIXED:
$ ./lssubsys -am
cpuset
ns <- controller is in hierarchy but it is not mounted
cpu,devices <- controller is in hierarchy but it is not mounted
cpuacct /cgroup/memoryd
memory /cgroup/memory
freezer
net_cls /cgroup/net_cls
Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-By: Jan Safranek <jsafrane@redhat.com>