On Thu, Aug 11, 2011 at 9:04 AM, Jan Safranek <[email protected]> wrote:
> Reworked the error handling in cgroup_unload_cgroups.
>

looks a lot cleaner!

> Signed-off-by: Jan Safranek <[email protected]>

Acked-by: Dhaval Giani <[email protected]>

> ---
>
>  src/config.c |   17 +++++------------
>  1 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/src/config.c b/src/config.c
> index fc4901f..2573718 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -877,12 +877,7 @@ int cgroup_unload_cgroups(void)
>        }
>
>        error = cgroup_get_controller_begin(&ctrl_handle, &info);
> -       if (error && error != ECGEOF) {
> -               ret = error;
> -               goto out_error;
> -       }
> -
> -       while (error != ECGEOF) {
> +       while (error == 0) {
>                if (!curr_path || strcmp(info.path, curr_path) != 0) {
>                        if (curr_path)
>                                free(curr_path);
> @@ -901,13 +896,11 @@ int cgroup_unload_cgroups(void)
>                }
>
>                error = cgroup_get_controller_next(&ctrl_handle, &info);
> -
> -               if (error && error != ECGEOF) {
> -                       ret = error;
> -                       goto out_error;
> -               }
>        }
> -
> +       if (error == ECGEOF)
> +               error = 0;
> +       if (error)
> +               ret = error;
>  out_error:
>        if (curr_path)
>                free(curr_path);
>
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it.
> http://p.sf.net/sfu/wandisco-dev2dev
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to