summaryrefslogtreecommitdiffstats
path: root/lib/network/monitor.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-05-02 14:14:06 +0000
committerOlivier Blin <oblin@mandriva.com>2008-05-02 14:14:06 +0000
commitf821d6bde3681764bebc835a9a8d381b2a1259fb (patch)
tree7e597d23369a7ce28e8142a9244b6fc4f55fc828 /lib/network/monitor.pm
parentb6736018c66c409a5e8b65ea3639897ceb41fd97 (diff)
downloaddrakx-net-f821d6bde3681764bebc835a9a8d381b2a1259fb.tar
drakx-net-f821d6bde3681764bebc835a9a8d381b2a1259fb.tar.gz
drakx-net-f821d6bde3681764bebc835a9a8d381b2a1259fb.tar.bz2
drakx-net-f821d6bde3681764bebc835a9a8d381b2a1259fb.tar.xz
drakx-net-f821d6bde3681764bebc835a9a8d381b2a1259fb.zip
simplify has_roaming definition
Diffstat (limited to 'lib/network/monitor.pm')
-rw-r--r--lib/network/monitor.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/network/monitor.pm b/lib/network/monitor.pm
index 43e9e78..9f5e302 100644
--- a/lib/network/monitor.pm
+++ b/lib/network/monitor.pm
@@ -17,14 +17,15 @@ sub new {
sub list_wireless {
my ($monitor, $o_intf) = @_;
my ($results, $list, %networks);
+ my $has_roaming;
#- first try to use mandi
eval {
$results = $monitor->call_method('ScanResults');
$list = $monitor->call_method('ListNetworks');
+ $has_roaming = 1;
};
- my $has_roaming = defined $results && defined $list;
#- try wpa_cli if we're root
- if ($@ && !$>) {
+ if (!$has_roaming && !$>) {
$results = `/usr/sbin/wpa_cli scan_results 2>/dev/null`;
$list = `/usr/sbin/wpa_cli list_networks 2>/dev/null`;
}