From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Justin T. Gibbs" Subject: [PATCH] Fix gdbserver-xen support on older kernels. Date: Wed, 24 Mar 2010 15:22:39 -0600 Message-ID: <4BAA829F.6060105@scsiguy.com> Reply-To: gibbs@scsiguy.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020908030902020504050603" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------020908030902020504050603 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --------------020908030902020504050603 Content-Type: text/plain; name="xc_ptrace.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xc_ptrace.patch" 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); } --------------020908030902020504050603 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------020908030902020504050603--