[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 04/13] libxc: xc_physdev_map return -1 and populate errno.
The users of these (qemu) check for a negative value so we are safe in regards to that. However they also use the return value to inform the user of the error. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- tools/libxc/xc_physdev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c index cf02d85..9b064b8 100644 --- a/tools/libxc/xc_physdev.c +++ b/tools/libxc/xc_physdev.c @@ -43,8 +43,10 @@ int xc_physdev_map_pirq(xc_interface *xch, struct physdev_map_pirq map; if ( !pirq ) - return -EINVAL; - + { + errno = EINVAL; + return -1; + } memset(&map, 0, sizeof(struct physdev_map_pirq)); map.domid = domid; map.type = MAP_PIRQ_TYPE_GSI; @@ -72,8 +74,10 @@ int xc_physdev_map_pirq_msi(xc_interface *xch, struct physdev_map_pirq map; if ( !pirq ) - return -EINVAL; - + { + errno = EINVAL; + return -1; + } memset(&map, 0, sizeof(struct physdev_map_pirq)); map.domid = domid; map.type = MAP_PIRQ_TYPE_MSI; -- 2.1.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |