cgroup_parse_config() should properly initialize its global variables, so
it can be called several times safely, i.e. several config files can be
parsed in sequence. The call to cgroup_parse_config() *rewrites* previous
result, it does not *add* new groups/mounts to global tables.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
goto err;
}
+ /* Clear all internal variables so this function can be called twice. */
init_cgroup_table(config_cgroup_table, MAX_CGROUPS);
+ memset(config_namespace_table, 0, sizeof(config_namespace_table));
+ memset(config_mount_table, 0, sizeof(config_mount_table));
+ config_table_index = 0;
+ namespace_table_index = 0;
+ cgroup_table_index = 0;
/*
* Parser calls longjmp() on really fatal error (like out-of-memory).