qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/7] smbios: Normalize smbios_entry_add()'s erro


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/7] smbios: Normalize smbios_entry_add()'s error handling to exit(1)
Date: Wed, 17 Jul 2013 11:53:40 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 07/17/2013 11:16 AM, Markus Armbruster wrote:
> It exits on all error conditions but one, where it returns -1.
> Normalize, and return void.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  arch_init.c              |  4 +---
>  hw/i386/smbios.c         | 10 +++++-----
>  include/hw/i386/smbios.h |  2 +-
>  3 files changed, 7 insertions(+), 9 deletions(-)
> 

> @@ -242,5 +242,5 @@ int smbios_entry_add(const char *t)
>      }
>  
>      error_report("Must specify type= or file=");
> -    return -1;
> +    exit(1);

I hate magic numbers; wouldn't exit(EXIT_FAILURE) be more explicit at
your intent?  At any rate, you're not the first person to use exit(1), so:

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]