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

Re: [libvirt] [PATCHv2 4/4] Remove erroneous setting of return value to errno.



On 07/21/2010 09:21 AM, Daniel Veillard wrote:
> 
>   ACK, but it seems to me ret being initialized to -1, maybe it's better
> to be consistent and on all error do a ret = -errno; before
> virReportSystemError and the goto cleanup.

If you have the convention of returning -errno, then you must not return
-1 unless you meant to report EPERM.  I agree with Laine's approach of
initializing to 0 in this case, since you don't want to leak an
unintended -1 if that was not the real error.

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

Attachment: signature.asc
Description: OpenPGP digital signature


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