All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] Fix gdbserver-xen support on older kernels.
Date: Wed, 24 Mar 2010 15:22:39 -0600	[thread overview]
Message-ID: <4BAA829F.6060105@scsiguy.com> (raw)

[-- 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

                 reply	other threads:[~2010-03-24 21:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BAA829F.6060105@scsiguy.com \
    --to=gibbs@scsiguy.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.