Protect against killing pid's that would "killall" or "kill self"

This commit is contained in:
unknown 2007-04-23 11:01:22 +02:00
parent aa043d73bf
commit d19d4b3f4f

View File

@ -1086,6 +1086,13 @@ sub mtr_kill_processes ($) {
foreach my $pid (@$pids)
{
if ($pid <= 0)
{
mtr_warning("Trying to kill illegal pid: $pid");
next;
}
foreach my $sig (15, 9)
{
last if mtr_im_kill_process([ $pid ], $sig, 10, 1);