From dddb895c7e094d41d6fceae88fa352e88bd26397 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 2 Dec 2010 15:00:40 +0100 Subject: [PATCH] if a hierarchy with more controllers is parsed before hierarchy with less controllers as the last two hierarchies, then the output of cgsnapshot is broken - test is missing Signed-off-by: Ivana Hutarova Varekova Acked-by: Jan Safranek Signed-off-by: Jan Safranek --- src/tools/cgsnapshot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/cgsnapshot.c b/src/tools/cgsnapshot.c index 198fdd7f..b5710a35 100644 --- a/src/tools/cgsnapshot.c +++ b/src/tools/cgsnapshot.c @@ -553,9 +553,11 @@ static int parse_controllers(cont_name_t cont_names[CG_CONTROLLER_MAX], ret = cgroup_get_controller_next(&handle, &controller); } - if (max != 0) + if (max != 0) { + (controllers[max])[0] = '\0'; ret = display_controller_data( controllers, program_name); + } cgroup_get_controller_end(&handle); if (ret != ECGEOF) -- 2.47.2