summaryrefslogtreecommitdiffstats
path: root/bin/net_monitor
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-20 19:52:33 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-20 19:52:33 +0000
commitb3111e7e9c262d8c71e23a6dc78d5d7a888dacc3 (patch)
treed42205550d30ec092f9743748bcec938017f985b /bin/net_monitor
parent683619174a6cd634655ac6a489b5a6efb1b5b3cc (diff)
downloaddrakx-net-b3111e7e9c262d8c71e23a6dc78d5d7a888dacc3.tar
drakx-net-b3111e7e9c262d8c71e23a6dc78d5d7a888dacc3.tar.gz
drakx-net-b3111e7e9c262d8c71e23a6dc78d5d7a888dacc3.tar.bz2
drakx-net-b3111e7e9c262d8c71e23a6dc78d5d7a888dacc3.tar.xz
drakx-net-b3111e7e9c262d8c71e23a6dc78d5d7a888dacc3.zip
perl_checker cleanups
Diffstat (limited to 'bin/net_monitor')
-rwxr-xr-xbin/net_monitor20
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/net_monitor b/bin/net_monitor
index 5c27f85..eb9a37a 100755
--- a/bin/net_monitor
+++ b/bin/net_monitor
@@ -183,17 +183,17 @@ sub main_quit() {
ugtk2->exit(0);
}
-sub getcurrentintf {
+sub getcurrentintf() {
my $currp = $notebook->get_current_page;
foreach (@interfaces) {
my $intf = $_;
- return $intf if ($monitor->{$intf}{page} == $currp)
+ return $intf if $monitor->{$intf}{page} == $currp;
}
}
-sub intf_reset {
+sub intf_reset() {
# resets counters for currently selected tab
- my $intf = getcurrentintf;
+ my $intf = getcurrentintf();
if (defined $intf) {
$monitor->{$intf}{totalt} = 0;
$monitor->{$intf}{totalr} = 0;
@@ -276,7 +276,7 @@ sub connection() {
gtkflush();
- print ("Action on " . getcurrentintf() . "\n");
+ print "Action on " . getcurrentintf() . "\n";
$tool_pid =
$wasconnected == 1
@@ -300,17 +300,17 @@ sub rescan() {
# prevent for case 32 bits or 64 bits unsigned value of /proc (if rotate to zero)
if ($diffr < 0) {
if ($refr < 2**32) { # transition (2^32 - 1) to 0
- $diffr += 2**32
+ $diffr += 2**32;
} else { $diffr += 2**64 } # transition (2^64 - 1) to 0
# { $diffr = 0; $monitor->{$intf}{totalr} = 0 } # Alternatively, if bug for very big number in perl
- };
+ }
# prevent for case 32 bits or 64 bits unsigned value of /proc (if rotate to zero)
if ($difft < 0) {
if ($reft < 2**32) { # transition (2^32 - 1) to 0
- $difft += 2**32
+ $difft += 2**32;
} else { $difft += 2**64 } # transition (2^64 - 1) to 0
# { $difft = 0; $monitor->{$intf}{totalt} = 0 } # Alternatively, if bug for very big number in perl
- };
+ }
$monitor->{$intf}{totalr} += $diffr;
$monitor->{$intf}{totalt} += $difft;
@@ -448,7 +448,7 @@ sub update() {
gtknew('HBox', spacing => 5, border_width => 5, children_tight => [
color_button($gca, $colora),
N("average") ]),
- gtknew('Button', text => N("Reset counters"), sensitive => 1, clicked => sub { intf_reset })
+ gtknew('Button', text => N("Reset counters"), sensitive => 1, clicked => sub { intf_reset() })
]),
0, gtknew('VBox', border_width => 5, children_tight => [
gtknew('Frame', text => N("Local measure"), shadow_type => 'etched_out', child =>