[libvirt] [PATCH] logging: make VIR_ERROR and friends preserve errno

Eric Blake eblake at redhat.com
Thu Feb 17 21:04:47 UTC 2011


On 02/17/2011 04:01 AM, Jiri Denemark wrote:
>> Followup to commit 17e19add, and would have prevented the bug
>> independently fixed in commit 76c57a7c.
>>
> I would have implemented this as
> 
>      if (...)
> -        return;
> +        goto out;
> 
> ...
> 
>      VIR_FREE(msg);
> +
> +out:
> +    errno = saved_errno;
>  }

Yeah, that does look a bit nicer.

> 
> to avoid having to set errno in several places but I can live with your
> solution too :-)
> 
> ACK regardless on which one of the two versions you decide to push.

Pushed with the modification to use goto.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110217/f7803ef8/attachment-0001.sig>


More information about the libvir-list mailing list