aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_ptrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libxc/xc_ptrace.c')
-rw-r--r--tools/libxc/xc_ptrace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/libxc/xc_ptrace.c b/tools/libxc/xc_ptrace.c
index 725a022339..e91ac56da6 100644
--- a/tools/libxc/xc_ptrace.c
+++ b/tools/libxc/xc_ptrace.c
@@ -193,6 +193,13 @@ map_domain_va(
if (map == NULL)
return NULL;
+ /*
+ * Due to the use of API fallback code in libxc, errno may
+ * be clobberred during successful operations. Since the caller
+ * of xc_ptrace is depending on errno for return status, clear
+ * errno here.
+ */
+ errno = 0;
return map + (va & ~PAGE_MASK);
}