summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2011-03-02 18:27:41 +0000
committerMichael Snyder <msnyder@specifix.com>2011-03-02 18:27:41 +0000
commitd3290ce50f7f9ce0a391d88d1f2cbc992397e91c (patch)
tree32bf228d268e499e15429eed0a1eda92a39b31fc /gdb
parente2d44e19f97ffa06c7a7332ec2bcc860ef23e673 (diff)
downloadgdb-d3290ce50f7f9ce0a391d88d1f2cbc992397e91c.tar.gz
2011-03-02 Michael Snyder <msnyder@vmware.com>
* linux-nat.c (linux_nat_xfer_partial): Preserve errno around a function call.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/linux-nat.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 257586bfb08..15c73adce91 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2011-03-02 Michael Snyder <msnyder@vmware.com>
+ * linux-nat.c (linux_nat_xfer_partial): Preserve errno around
+ a function call.
+
* record.c (record_restore): Move printf to before error return.
2011-03-02 Yao Qi <yao@codesourcery.com>
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 54566450e59..922a2cf9524 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4032,7 +4032,7 @@ linux_nat_xfer_partial (struct target_ops *ops, enum target_object object,
static int
linux_thread_alive (ptid_t ptid)
{
- int err;
+ int err, tmp_errno;
gdb_assert (is_lwp (ptid));
@@ -4040,12 +4040,12 @@ linux_thread_alive (ptid_t ptid)
running thread errors out claiming that the thread doesn't
exist. */
err = kill_lwp (GET_LWP (ptid), 0);
-
+ tmp_errno = errno;
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LLTA: KILL(SIG0) %s (%s)\n",
target_pid_to_str (ptid),
- err ? safe_strerror (err) : "OK");
+ err ? safe_strerror (tmp_errno) : "OK");
if (err != 0)
return 0;