On 2013/8/6 15:15, Libo Chen wrote:


Hi Ivana,

        what do you think about this patch ?
> 
> we should check invalite parameter, and then print a warning
> 
> Signed-off-by: Libo Chen <clbchenlibo.c...@huawei.com>
> ---
>  src/tools/cgconfig.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/src/tools/cgconfig.c b/src/tools/cgconfig.c
> index 6aeea0f..aee84bc 100644
> --- a/src/tools/cgconfig.c
> +++ b/src/tools/cgconfig.c
> @@ -133,10 +133,18 @@ int main(int argc, char *argv[])
>                       break;
>               default:
>                       usage(argv[0]);
> -                     break;
> +                     error = -1;
> +                     goto err;
>               }
>       }
> 
> +     if (argv[optind]) {
> +             fprintf(stderr, "%s: "
> +                     "wrong arguments (%s)\n",
> +                     argv[0], argv[optind]);
> +             error = -1;
> +             goto err;
> +     }
>       /* set default permissions */
>       default_group = cgroup_new_cgroup("default");
>       if (!default_group) {
> 



------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to