[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix gdbserver-xen support on older kernels.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1269502915 0
# Node ID 0a91254533dc27c62af1570abedf6524a1035b8e
# Parent  eb7812d0d6104c9f10a2c0a19c127c76e3c71f82
Fix gdbserver-xen support on older kernels.

The xc_ptrace API relies on errno for passing success/failure
indication back to callers.  However, mapping operations that fall
back on legacy APIs may leave errno set to a non-zero result even
thought the operation is successful.  This patch resets errno after
successful map operations so that xc_ptrace doesn't inadvertently
return a failure.

Signed-off-by: Justin Gibbs <gibbs@xxxxxxxxxxx>
---
 tools/libxc/xc_ptrace.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -r eb7812d0d610 -r 0a91254533dc tools/libxc/xc_ptrace.c
--- a/tools/libxc/xc_ptrace.c   Thu Mar 25 07:40:40 2010 +0000
+++ b/tools/libxc/xc_ptrace.c   Thu Mar 25 07:41:55 2010 +0000
@@ -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);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.