diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-04 16:54:19 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-04 16:54:19 +0000 |
commit | 68c3c1cd6e89d6a0f91f6c86510ec661864da336 (patch) | |
tree | 13b7ddd23376813d75e546241bcd09a8c8edd8a9 /perl-install/detect_devices.pm | |
parent | d1e96894b39e141a9c0fa6ef999eb751ef87ebf4 (diff) | |
download | drakx-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar drakx-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar.gz drakx-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar.bz2 drakx-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar.xz drakx-68c3c1cd6e89d6a0f91f6c86510ec661864da336.zip |
no_comment
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index c0cdb221d..47220af91 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -31,7 +31,9 @@ sub get { sub hds() { grep { $_->{type} eq 'hd' } get(); } sub cdroms() { grep { $_->{type} eq 'cdrom' } get(); } sub floppies() { - (grep { tryOpen($_) } qw(fd0 fd1)), + (grep { + my $fd = tryOpen(); + } qw(fd0 fd1)), (grep { $_->{type} eq 'fd' } get()); } @@ -160,12 +162,12 @@ sub hasNetDevice($) { c::hasNetDevice($_[0]) } sub tryOpen($) { local *F; - sysopen F, devices::make($_[0]), c::O_NONBLOCK(); + sysopen F, devices::make($_[0]), c::O_NONBLOCK() and \*F; } sub syslog { my $file = "/var/log/dmesg"; -r $file or $file = "/tmp/syslog"; - cat_($file); - `dmesg`; + my @l = cat_($file); + @l ? @l : `dmesg`; } |