On Thu, Sep 5, 2013 at 2:36 AM, Ivana Varekova <varek...@redhat.com> wrote:

>
>
> ----- Original Message -----
> > From: "Dhaval Giani" <dhaval.gi...@gmail.com>
> > To: "Libo Chen" <clbchenlibo.c...@huawei.com>
> > Cc: "Ivana Hutarova Varekova" <varek...@redhat.com>, "Jan Safranek" <
> jsafr...@redhat.com>, "Libcg Development list"
> > <libcg-devel@lists.sourceforge.net>, "Li Zefan" <lize...@huawei.com>,
> "Huang Qiang" <h.huangqi...@huawei.com>,
> > "Wengmeiling" <wengmeiling.w...@huawei.com>, "libo chen" <
> libo.c...@huawei.com>
> > Sent: Thursday, September 5, 2013 5:35:46 AM
> > Subject: Re: [PATCH v4 4/7] cgconfig: change function usage behavior
> >
> > On Wed, Sep 4, 2013 at 11:29 PM, Libo Chen
> > <clbchenlibo.c...@huawei.com>wrote:
> >
> > > remove exit from function usage and add a structure like usage function
> > > in the other tools.
> > > This is suggested by Ivana Hutarova Varekova <varek...@redhat.com>
> > >
> > > now usage willn't exit, so we should help it in err case.
> > >
> > > v4:
> > >  - fix some code style reported by checkpatch.pl
> > >
> > > Signed-off-by: Libo Chen <clbchenlibo.c...@huawei.com>
> > > ---
> > >  src/tools/cgconfig.c |   61
> > > ++++++++++++++++++++++++++++---------------------
> > >  1 files changed, 35 insertions(+), 26 deletions(-)
> > >
> > > diff --git a/src/tools/cgconfig.c b/src/tools/cgconfig.c
> > > index 900c235..6ed4c77 100644
> > > --- a/src/tools/cgconfig.c
> > > +++ b/src/tools/cgconfig.c
> > > @@ -35,29 +35,34 @@
> > >
> > >  static struct cgroup_string_list cfg_files;
> > >
> > > -static void usage(char *progname)
> > > +static void usage(int status, char *progname)
> > >  {
> > > -       printf("Usage: %s [-h] [-f mode] [-d mode] [-s mode] "\
> > > +       if (status != 0) {
> > > +               fprintf(stderr, "Wrong input parameters, "\
> > > +                       "try %s -h' for more information.\n",
> progname);
> > >
> >
> > Add a return here, and you don't need the else.
> All other tools use if .. else .. version so the present version with
> "else" and without "return" are ok for me.
>

Sure, but all that means is that they too need to be fixed up. The
additional indentation does make the code look uglier, and harder to read,
so I would much rather have it fixed up.

Thanks!
Dhaval
------------------------------------------------------------------------------
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=58041391&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