----- Original Message -----
> From: "Libo Chen" <[email protected]>
> To: [email protected]
> Cc: "dhaval giani" <[email protected]>, [email protected], 
> [email protected],
> [email protected], "h huangqiang" <[email protected]>, "wengmeiling 
> weng" <[email protected]>,
> "libo chen" <[email protected]>
> Sent: Tuesday, September 3, 2013 10:49:14 AM
> Subject: [PATCH v3 1/8] cgcreate: add err check
> 
> From: Libo Chen <[email protected]>
> 
> cgroup still can be created even if giving invalid -d,-f,-s parameter
> e.g.
>         cgcreate -g cpu:/test -d 888
>       "888" is invalid, but test will be cgreated.
> 
>       So we should exit if -d,-f or -s is invalid
> 
> v2:
>  - add nonzero return value
> 
> Signed-off-by: Libo Chen <[email protected]>
Acked-by: Ivana Hutarova Varekova <[email protected]>
> ---
>  src/tools/cgcreate.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/src/tools/cgcreate.c b/src/tools/cgcreate.c
> index b0003b1..f1920ea 100644
> --- a/src/tools/cgcreate.c
> +++ b/src/tools/cgcreate.c
> @@ -139,14 +139,20 @@ int main(int argc, char *argv[])
>               case 'd':
>                       dirm_change = 1;
>                       ret = parse_mode(optarg, &dir_mode, argv[0]);
> +                     if (ret)
> +                             goto err;
>                       break;
>               case 'f':
>                       filem_change = 1;
>                       ret = parse_mode(optarg, &file_mode, argv[0]);
> +                     if (ret)
> +                             goto err;
>                       break;
>               case 's':
>                       filem_change = 1;
>                       ret = parse_mode(optarg, &tasks_mode, argv[0]);
> +                     if (ret)
> +                             goto err;
>                       break;
>               default:
>                       usage(1, argv[0]);
> --
> 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

Reply via email to