From: Jan Safranek Date: Thu, 2 Dec 2010 14:00:40 +0000 (+0100) Subject: if a hierarchy with more controllers is parsed before hierarchy with less X-Git-Tag: v0.37~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dddb895c7e094d41d6fceae88fa352e88bd26397;p=thirdparty%2Flibcgroup.git 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 --- 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)