[libvirt] [PATCHv2 4/4] Remove erroneous setting of return value to errno.
eblake at redhat.com
Wed Jul 21 15:37:25 UTC 2010
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 at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 619 bytes
Desc: OpenPGP digital signature
More information about the libvir-list