* [PATCH] Fix gdbserver-xen support on older kernels.
@ 2010-03-24 21:22 Justin T. Gibbs
0 siblings, 0 replies; only message in thread
From: Justin T. Gibbs @ 2010-03-24 21:22 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
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@scsiguy.com>
[-- Attachment #2: xc_ptrace.patch --]
[-- Type: text/plain, Size: 603 bytes --]
Index: xen-4.0.0-testing/tools/libxc/xc_ptrace.c
===================================================================
--- a/tools/libxc/xc_ptrace.c Mon Mar 15 13:25:30 2010 +0000
+++ b/tools/libxc/xc_ptrace.c Mon Mar 15 10:22:23 2010 -0600
@@ -193,6 +193,13 @@
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);
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-03-24 21:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 21:22 [PATCH] Fix gdbserver-xen support on older kernels Justin T. Gibbs
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.