with proper value (ENOMEM) when reporting failures.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
---
[v1: errno before using PERROR]
---
 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..34185cf 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -54,6 +54,7 @@ xc_core_arch_memory_map_get(xc_interface *xch, struct 
xc_core_arch_context *unus
     map = malloc(sizeof(*map));
     if ( map == NULL )
     {
+        errno = ENOMEM;
         PERROR("Could not allocate memory");
         return -1;
     }
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index d8846f1..b5d442d 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -59,6 +59,7 @@ xc_core_arch_memory_map_get(xc_interface *xch, struct 
xc_core_arch_context *unus
     map = malloc(sizeof(*map));
     if ( map == NULL )
     {
+        errno = ENOMEM;
         PERROR("Could not allocate memory");
         return -1;
     }
-- 
2.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to