summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-05-11 12:28:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-05-11 12:28:31 +0000
commit0dbcea82bd862926e42e46e3ac2b718ead1205d9 (patch)
treead17579df8b80ee6d414f8760d07ac8bfc9fbb62
parentd14fa1e8dbb5c7263e07dd513fa9d5c8f00e8fba (diff)
downloaddrakx-backup-do-not-use-0dbcea82bd862926e42e46e3ac2b718ead1205d9.tar
drakx-backup-do-not-use-0dbcea82bd862926e42e46e3ac2b718ead1205d9.tar.gz
drakx-backup-do-not-use-0dbcea82bd862926e42e46e3ac2b718ead1205d9.tar.bz2
drakx-backup-do-not-use-0dbcea82bd862926e42e46e3ac2b718ead1205d9.tar.xz
drakx-backup-do-not-use-0dbcea82bd862926e42e46e3ac2b718ead1205d9.zip
rewrite a little probeSerialDevices(), the beginning is still very strange
-rw-r--r--perl-install/detect_devices.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index b7a49cb32..3e699ba24 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -513,7 +513,8 @@ sub getUPS() {
my $POWER_USAGE = 0x840020;
my $hiddev_find_application = sub {
my ($fd, $usage) = @_;
- my ($i, $ret) = 0;
+ my $i = 0;
+ my $ret;
do { $i++ } while ($ret = ioctl($fd, c::HIDIOCAPPLICATION(), $i)) && $ret != $usage;
return $ret == $usage ? 1 : 0;
};
@@ -743,9 +744,14 @@ sub probeSerialDevices() {
print STDERR "Please wait while probing serial ports...\n";
#- start probing all serial ports... really faster than before ...
#- ... but still take some time :-)
- my %current; foreach (run_program::get_stdout('serial_probe')) {
- $serialprobe{$current{DEVICE}} = { %current } and %current = () if /^\s*$/ && $current{DEVICE};
- $current{$1} = $2 if /^([^=]+)=(.*?)\s*$/;
+ my %current;
+ foreach (run_program::get_stdout('serial_probe')) {
+ if (/^\s*$/) {
+ $serialprobe{$current{DEVICE}} = { %current } if $current{DEVICE};
+ %current = ();
+ } elsif (/^([^=]+)=(.*?)\s*$/) {
+ $current{$1} = $2;
+ }
}
foreach (values %serialprobe) {