]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
From: Ivana Hutarova Varekova <varekova@redhat.com>
authorIvana Hutarova Varekova <varekova@redhat.com>
Thu, 10 May 2012 05:07:41 +0000 (07:07 +0200)
committerIvana Hutarova Varekova <varekova@redhat.com>
Thu, 10 May 2012 05:07:41 +0000 (07:07 +0200)
commitc741b742bd0707f5ab58e6a29196eab42080a233
tree7bcac4dbba70d9ff3bc5e96ece21c5551a21ce7b
parentb5563953ecadedb3f6796d2fb1d3257899439f7e
From: Ivana Hutarova Varekova <varekova@redhat.com>

lscgroup: fix path name trimming

lscgroup tool in display_controller_data procedure trimmed relative path
name too strictly, thus if the path have no leading "/" sign then the first
character was trimmed too.

More precisely the relative path is taken from the full path - path to the
controller root and relative path given on command line (with all
characters "/") + character "/" at the end of path. The length of suffix
which describe relative path is count from trimmed relative path given on
command line (without characters "/" at the beginning and at the end).
There have to be used the same relative path in both cases and -1 to the
length.

CHANGELOG v1:
* more detailed description
* fix the problem with "/" sign at the end of path too

EXAMPLE
without the patch:
$ lscgroup freezer:libvirt
freezer:/ibvirt/
freezer:/ibvirt/lxc
freezer:/ibvirt/qemu

with the patch:
$ lscgroup freezer:libvirt
freezer:/libvirt/
freezer:/libvirt/lxc
freezer:/libvirt/qemu

this patch fixes the problem.

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Acked-By: Jan Safranek<jsafrane@redhat.com>
src/tools/lscgroup.c