summaryrefslogtreecommitdiffstats
path: root/lib/network/monitor.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-02-29 00:37:03 +0000
committerOlivier Blin <oblin@mandriva.com>2008-02-29 00:37:03 +0000
commitc7bc921709ee19e2e3b9482565d1b9a285fa18fe (patch)
treedfdd20c1f3616e0b92918e73ebe887be22717583 /lib/network/monitor.pm
parent40ebe50d6e3d3c78006627b2bca9548461eb5676 (diff)
downloaddrakx-net-c7bc921709ee19e2e3b9482565d1b9a285fa18fe.tar
drakx-net-c7bc921709ee19e2e3b9482565d1b9a285fa18fe.tar.gz
drakx-net-c7bc921709ee19e2e3b9482565d1b9a285fa18fe.tar.bz2
drakx-net-c7bc921709ee19e2e3b9482565d1b9a285fa18fe.tar.xz
drakx-net-c7bc921709ee19e2e3b9482565d1b9a285fa18fe.zip
do not crash with prism54 driver which reports quality with division by zero
(assume max signal quality is 255 instead, from Eddy De Greef, #34845 and #37879, backport from trunk)
Diffstat (limited to 'lib/network/monitor.pm')
-rw-r--r--lib/network/monitor.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/network/monitor.pm b/lib/network/monitor.pm
index 5ae0f4a..151d6cb 100644
--- a/lib/network/monitor.pm
+++ b/lib/network/monitor.pm
@@ -64,6 +64,7 @@ sub list_wireless {
my $quality_match = qr/Quality[:=](\S*)/;
my $eval_quality = sub {
my ($qual) = @_;
+ $qual =~ s!/0+$!/255!; #- prism54 reports quality with division by zero
$qual =~ m!/! ? eval($qual)*100 : $qual;
};
foreach (@list) {