----- Original Message ----- > From: "Dhaval Giani" <dhaval.gi...@gmail.com> > To: "Ivana Varekova" <varek...@redhat.com> > Cc: "Libo Chen" <clbchenlibo.c...@huawei.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 2:30:29 PM > Subject: Re: [PATCH v4 4/7] cgconfig: change function usage behavior > > 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 > Ok, if yo don't have any problem with it I will merge this version and create a patchset which fix this stuff for all tools. Is it ok for you? Ivana
------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. Consolidate legacy IT systems to a single system of record for IT 2. Standardize and globalize service processes across IT 3. Implement zero-touch automation to replace manual, redundant tasks http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel