Re: [PATCHv2 1/4] Change virFileOperation to return -errno (ie < 0) on error.

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

 



On Mon, Jul 19, 2010 at 09:21:52PM -0400, Laine Stump wrote:
> virFileOperation previously returned 0 on success, or the value of
> errno on failure. Although there are other functions in libvirt that
> use this convention, the preferred (and more common) convention is to
> return 0 on success and -errno (or simply -1 in some cases) on
> failure. This way the check for failure is always (ret < 0).
> 
> * src/util/util.c - change virFileOperation and virFileOperationNoFork to
>                     return -errno on failure.
> 
> * src/storage/storage_backend.c, src/qemu/qemu_driver.c
>   - change the hook functions passed to virFileOperation to return
>     -errno on failure.

  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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