From f821d6bde3681764bebc835a9a8d381b2a1259fb Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 2 May 2008 14:14:06 +0000 Subject: simplify has_roaming definition --- lib/network/monitor.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/network/monitor.pm') 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`; } -- cgit v1.2.1