]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Change virFileOperation to return -errno (ie < 0) on error.
authorLaine Stump <laine@laine.org>
Mon, 19 Jul 2010 23:25:58 +0000 (19:25 -0400)
committerLaine Stump <laine@laine.org>
Wed, 21 Jul 2010 18:32:35 +0000 (14:32 -0400)
commit2ad04f78536ce35f437fb2785aad9155f551b6d0
tree069b50d3022bcece15a56914c819007b13d86c2c
parentee0684aba4f537659506d8562fc0531ad33a506e
Change virFileOperation to return -errno (ie < 0) on error.

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.
src/qemu/qemu_driver.c
src/storage/storage_backend.c
src/util/util.c