[GDB/Linux] Avoid stale errno
authorPedro Alves <palves@redhat.com>
Tue, 15 Jul 2014 15:22:14 +0000 (16:22 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 15 Jul 2014 15:22:14 +0000 (16:22 +0100)
commit57745c903f78ffdb10a6198a6e35e5a1e63ea4b0
tree82abdd289ffc34b014cec9b0225050169732586f
parent2d40be181fad7aed4aeabafd36529f3684b8bcab
[GDB/Linux] Avoid stale errno

The fix that went into GDBserver is also needed on the GDB side.

Although most compilers follow right-to-left evaluation order, the
order of evaluation of a function call's arguments is really
unspecified.  target_pid_to_str may well clobber errno when we get to
evaluate the third argument to fprintf_unfiltered.

gdb/
2014-07-15  Pedro Alves  <palves@redhat.com>

* linux-nat.c (kill_callback): Save errno and work with saved
copy.
gdb/ChangeLog
gdb/linux-nat.c