From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH RFC 03/14] libxc: Fix xc_domain_get_tsc_info returning -Exx instead of -1. Date: Fri, 13 Mar 2015 15:40:32 -0400 Message-ID: <20150313194032.GA9130@l.oracle.com> References: <1426275083-8454-1-git-send-email-konrad.wilk@oracle.com> <1426275083-8454-4-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YWVRs-0002O5-Ti for xen-devel@lists.xenproject.org; Fri, 13 Mar 2015 19:40:45 +0000 Content-Disposition: inline In-Reply-To: <1426275083-8454-4-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, Mar 13, 2015 at 03:31:12PM -0400, Konrad Rzeszutek Wilk wrote: > Instead put the -Exx in errno. > > Signed-off-by: Konrad Rzeszutek Wilk > --- > tools/libxc/xc_domain.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c > index 845d1d7..eb3a5f2 100644 > --- a/tools/libxc/xc_domain.c > +++ b/tools/libxc/xc_domain.c > @@ -771,8 +771,10 @@ int xc_domain_get_tsc_info(xc_interface *xch, > > info = xc_hypercall_buffer_alloc(xch, info, sizeof(*info)); > if ( info == NULL ) > - return -ENOMEM; > - > + { > + errno = ENOMEM; > + return -1; > + } While I was doing that I saw a lot of other code doing: if ( xc_hypercall_bounce_pre (..) ) return -1; Should they all be fixed up to do: 'errno = ENOMEM' before returning -1?