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

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

 



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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]