On 03/28/2013 03:42 PM, Eric Blake wrote:
> On 03/28/2013 10:47 AM, Pavel Hrdina wrote:
>> Signed-off-by: Pavel Hrdina <phrd...@redhat.com>
>> ---
>>  qemu-img.c | 18 ++++++++++++------
>>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> Reviewed-by: Eric Blake <ebl...@redhat.com>
> 
>> +static int qemu_img_handle_error(Error *err)
>> +{
>> +    if (error_is_set(&err)) {
>> +        error_report("%s", error_get_pretty(err));
>> +        error_free(err);
>> +        return 1;
> 
> A non-bool positive number is unusual for errors (-1, or a true/false
> scheme, tend to be more common)...
> 
>> -    if (error_is_set(&local_err)) {
>> -        error_report("%s", error_get_pretty(local_err));
>> -        error_free(local_err);
>> -        return 1;
> 
> ...but it is accurate code motion, so it doesn't impact my review.

And in reading 9/11, I found out why it struck me as unusual.  I usually
spell it EXIT_FAILURE instead of 1, for a return status intended to be
used in a final exit() or return from main().  But that's a pre-existing
syndrome that affects much more of qemu-img.c, not worth changing here.

-- 
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