I agree with the patch - there is IMO no better way how to return some 
useful error text describing which group failed without breaking ABI.

On 08/17/2010 02:33 PM, Ivana Hutarova Varekova wrote:
> This patch changes the return value for nonexisting variable name -
>   the previous error message:
> # /sbin/cgconfigparser -l /tmp/cg2
> Loading configuration file /tmp/cg2 failed
> Cgroup values are not equal

Shouldn't cgroup_create_cgroup() return better value than 
ECGROUPNOTEQUAL when something (e.g. writing a parameter) fails???

>
> the new error message
> # /sbin/cgconfigparser -l /tmp/cg2
> can't create group "CBSFxx/Zcz6": Loading configuration file 
> /etc/cgconfig.conf failed
> Cgroup values are not equal
>
>
> Signed-off-by: Ivana Hutarova Varekova<[email protected]>
Reviewed-by: Jan Safranek <[email protected]>

> ---
>
>   src/config.c |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/src/config.c b/src/config.c
> index a29649a..33968eb 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -454,8 +454,11 @@ static int cgroup_config_create_groups(void)
>               error = cgroup_create_cgroup(cgroup, 0);
>               cgroup_dbg("creating group %s, error %d\n", cgroup->name,
>                       error);
> -             if (error)
> +             if (error) {
> +                     fprintf(stderr, "can't create group \"%s\": ",
> +                             cgroup->name);
>                       return error;
> +             }
>       }
>       return error;
>   }
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to