From: Konrad Rzeszutek Wilk Date: Thu, 19 Mar 2015 00:24:10 +0000 (-0400) Subject: libxc: xc_physdev_map return -1 and populate errno. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3556 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=479dab849873830184e3b53a903a3d3246b48e1a;p=xen.git 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 Acked-by: Ian Campbell --- diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c index cf02d85e6d..9b064b8787 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;