From 36a5356ee4f960f56d2b6891674e906503e49f62 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 16 Mar 2012 08:40:10 +0100 Subject: PIDS is now a hash --- loadbars | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/loadbars b/loadbars index 09bc2b8..7ceeed7 100755 --- a/loadbars +++ b/loadbars @@ -59,7 +59,7 @@ use constant { $| = 1; -my @PIDS : shared; +my %PIDS : shared; my %AVGSTATS : shared; my %CPUSTATS : shared; my %MEMSTATS : shared; @@ -200,7 +200,7 @@ sub terminate_pids (@) { display_info 'Terminating sub-processes, hasta la vista!'; $_->kill('TERM') for @threads; display_info_no_nl 'Terminating PIDs'; - for my $pid (@PIDS) { + for my $pid (keys %PIDS) { my $proc_table = Proc::ProcessTable->new(); for my $proc (@{$proc_table->table()}) { if ($proc->ppid == $pid) { @@ -252,7 +252,7 @@ BASH next; }; - push @PIDS, $pid; + $PIDS{$pid} = 1; # Toggle CPUs $SIG{USR1} = sub { $sigusr1 = 1 }; -- cgit v1.2.3