]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
lxc: Fix return values of veth.c functions
authorRyota Ozaki <ozaki.ryota@gmail.com>
Fri, 23 Jul 2010 17:25:56 +0000 (02:25 +0900)
committerLaine Stump <laine@laine.org>
Thu, 29 Jul 2010 18:08:35 +0000 (14:08 -0400)
commit938f2dbd9e259dc30dc6cf25d200db46bb30a838
treecb2401dff771b61660c75644bd388e49669ccf95
parent1999e4f8f880c33307254096a01765594fdfd1d0
lxc: Fix return values of veth.c functions

Previously, the functions in src/lxc/veth.c could sometimes return
positive values on failure rather than -1. This made accurate error
reporting difficult, and led to one failure to catch an error in a
calling function.

This patch makes all the functions in veth.c consistently return 0 on
success, and -1 on failure. It also fixes up the callers to the veth.c
functions where necessary.

Note that this patch may be related to the bug:

  https://bugzilla.redhat.com/show_bug.cgi?id=607496.

It will not fix the bug, but should unveil what happens.

* po/POTFILES.in - add veth.c, which previously had no translatable strings
* src/lxc/lxc_controller.c
* src/lxc/lxc_container.c
* src/lxc/lxc_driver.c    - fixup callers to veth.c, and remove error logs,
                            as they are now done in veth.c
* src/lxc/veth.c - make all functions consistently return -1 on error.
* src/lxc/veth.h - use ATTRIBUTE_NONNULL to protect against NULL args.
po/POTFILES.in
src/lxc/lxc_container.c
src/lxc/lxc_controller.c
src/lxc/lxc_driver.c
src/lxc/veth.c
src/lxc/veth.h