Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Linux: Use kill_lwp/tkill instead of kill when killing a, process
@ 2014-07-15 15:55 Pedro Alves
  2014-07-15 19:33 ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2014-07-15 15:55 UTC (permalink / raw)
  To: GDB Patches; +Cc: Jan Kratochvil

Another thing I noticed by inspection while fixing the
recent gdbserver kill crash.

Anyone know a reason we use plain "kill" here, instead
of tkill like everywhere else?

Passes testing on x86_64 Fedora 20 for me, at least...

--------------
From 08a773214245e9d6deb5060a6025c169fa8cdc4d Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Fri, 11 Jul 2014 11:36:20 +0100
Subject: [PATCH] Linux: Use kill_lwp/tkill instead of kill when killing a
 process

Since we use tkill everywhere, using kill to try to kill each lwp
individually looks suspiciously odd.  We should really be using tgkill
everywhere, but at least while we don't get there this makes us
consistent.

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

	* linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.

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

	* linux-nat.c (kill_callback): Use kill_lwp, not kill.
---
 gdb/gdbserver/linux-low.c | 2 +-
 gdb/linux-nat.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 0f4dbe2..521d9a2 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -895,7 +895,7 @@ linux_kill_one_lwp (struct lwp_info *lwp)
      everywhere.  */
 
   errno = 0;
-  kill (pid, SIGKILL);
+  kill_lwp (pid, SIGKILL);
   if (debug_threads)
     {
       int save_errno = errno;
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index c738abf..b50a88e 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -3704,7 +3704,7 @@ kill_callback (struct lwp_info *lp, void *data)
   /* PTRACE_KILL may resume the inferior.  Send SIGKILL first.  */
 
   errno = 0;
-  kill (ptid_get_lwp (lp->ptid), SIGKILL);
+  kill_lwp (ptid_get_lwp (lp->ptid), SIGKILL);
   if (debug_linux_nat)
     {
       int save_errno = errno;
-- 
1.9.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-16 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15 15:55 [PATCH] Linux: Use kill_lwp/tkill instead of kill when killing a, process Pedro Alves
2014-07-15 19:33 ` Jan Kratochvil
2014-07-15 21:03   ` Stan Shebs
2014-07-16 21:58     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox