On 04/18/2014 12:23 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng <f...@redhat.com> > --- > qemu-img.c | 68 > +++++++++++++++++++++++++++++++------------------------------- > 1 file changed, 34 insertions(+), 34 deletions(-) >
> /* Please keep in synch with qemu-img.texi */ > -static void help(void) > +static void help(bool error) This doesn't intuitively tell me whether 'true' is success (0 status) or failure (non-zero status). > { > const char *help_msg = > "qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 > Fabrice Bellard\n" > @@ -129,7 +129,7 @@ static void help(void) > printf("%s\nSupported formats:", help_msg); > bdrv_iterate_format(format_print, NULL); > printf("\n"); > - exit(1); > + exit(error ? 1 : 0); Oh - true for failure. I'd MUCH rather see: static void help(int status) ... exit(status) and all callers use: help(EXIT_SUCCESS) or help(EXIT_FAILURE) as appropriate. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature