On 13/03/15 19:31, Konrad Rzeszutek Wilk wrote: > with proper value (ENOMEM) when reporting failures. > > Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> > --- > 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; > } > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel