aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-03-02 18:27:41 +0000
committerMichael Snyder <msnyder@vmware.com>2011-03-02 18:27:41 +0000
commit8c6a60d1e629e93d54e8a004ececd686f6241ade (patch)
tree399ceb42eeea138923eda2e002795eaa3b1d94ec /gdb/linux-nat.c
parentd42de051e78088a2b486aeb03ff34d247fcdb6c2 (diff)
downloadgdb-8c6a60d1e629e93d54e8a004ececd686f6241ade.zip
gdb-8c6a60d1e629e93d54e8a004ececd686f6241ade.tar.gz
gdb-8c6a60d1e629e93d54e8a004ececd686f6241ade.tar.bz2
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/linux-nat.c')
-rw-r--r--gdb/linux-nat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 5456645..922a2cf 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;