From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH RFC 02/14] libxc: xc_core_arch_memory_map_get populate errno Date: Fri, 13 Mar 2015 20:20:32 +0000 Message-ID: <55034690.3070302@citrix.com> References: <1426275083-8454-1-git-send-email-konrad.wilk@oracle.com> <1426275083-8454-3-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 1YWW4U-00011F-ID for xen-devel@lists.xenproject.org; Fri, 13 Mar 2015 20:20:38 +0000 In-Reply-To: <1426275083-8454-3-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: Konrad Rzeszutek Wilk , 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 13/03/15 19:31, Konrad Rzeszutek Wilk wrote: > with proper value (ENOMEM) when reporting failures. > > Signed-off-by: Konrad Rzeszutek Wilk > --- > tools/libxc/xc_core_arm.c | 1 + > tools/libxc/xc_core_x86.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c > index 16508e7..888a3ac 100644 > --- a/tools/libxc/xc_core_arm.c > +++ b/tools/libxc/xc_core_arm.c > @@ -55,6 +55,7 @@ xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unus > if ( map == NULL ) > { > PERROR("Could not allocate memory"); > + errno = ENOMEM; PERROR catches and prints errno, so set ENOMEM before the PERROR() call to correct the error message. ~Andrew > return -1; > } > > diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c > index d8846f1..37b8522 100644 > --- a/tools/libxc/xc_core_x86.c > +++ b/tools/libxc/xc_core_x86.c > @@ -60,6 +60,7 @@ xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unus > if ( map == NULL ) > { > PERROR("Could not allocate memory"); > + errno = ENOMEM; > return -1; > } >