Hi Ivana,
what do you think about this question ?
Thanks!
Weng Meiling
On 2013/8/9 9:54, Weng Meiling wrote:
>
> From: Weng Meiling <[email protected]>
>
> Any line starting with '#' in cgconfig.conf is considered a comment
> and is ignored. But in cgrules.conf, no matter where the character
> '#' is, it will be replace with '\0'. So the similar rules get
> different results as following:
>
> the rule:
> *% cpu test
>
> all process will go to cpu's test cgroup, but thr rule:
> *# cpu test
>
> the cgred service will start fail.
>
> Is it necessary to unify the meaning of character '#' in cgconfig.conf
> and cgrules? Can we fix this like the patch or modify the parsing method
> of cgconfig.conf to use the '#' as comment tag no matter where it is?
>
> Signed-off-by: Weng Meiling <[email protected]>
> ---
> src/api.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/src/api.c b/src/api.c
> index e5e1959..ddd7871 100644
> --- a/src/api.c
> +++ b/src/api.c
> @@ -441,10 +441,15 @@ static void cgroup_free_rule_list(struct
> cgroup_rule_list *cg_rl)
> static char *cg_skip_unused_charactors_in_rule(char *rule)
> {
> char *itr;
> + char *first_letter;
>
> /* We ignore anything after a # sign as comments. */
> itr = strchr(rule, '#');
> - if (itr)
> + first_letter = rule;
> + while (first_letter && isblank(*first_letter))
> + first_letter++;
> +
> + if (itr && (itr == rule))
> *itr = '\0';
>
> /* We also need to remove the newline character. */
> -- 1.7.1
>
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel