Commit 870699c9 authored by Magnus Svensson's avatar Magnus Svensson

WL#4189 Only kill process that hasn't yet finished at end of mtr.pl. Improve debug printout

parent ab5c044e
...@@ -66,9 +66,11 @@ END { ...@@ -66,9 +66,11 @@ END {
for my $proc (values %running){ for my $proc (values %running){
if ( $proc->is_child($$) ){ if ( $proc->is_child($$) ){
#print "Killing: $proc\n"; #print "Killing: $proc\n";
if ($proc->wait_one(0)){
$proc->kill(); $proc->kill();
} }
} }
}
} }
...@@ -315,7 +317,7 @@ sub start_kill { ...@@ -315,7 +317,7 @@ sub start_kill {
$ret= system($safe_kill, $pid) >> 8; $ret= system($safe_kill, $pid) >> 8;
if (IS_CYGWIN and $ret == 3) if (IS_CYGWIN and $ret == 3)
{ {
print "safe_process is gone, kickstart the fake process\n"; print "safe_process is gone, kickstart the fake process, $self\n";
if (kill(15, $self->{SAFE_PID}) != 1){ if (kill(15, $self->{SAFE_PID}) != 1){
print STDERR "Failed to kickstart the fake process\n"; print STDERR "Failed to kickstart the fake process\n";
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment