summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-28 10:19:54 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-28 10:19:54 +0000
commit2d3b13d3b7e6f08f6310467ece7d399c5858d233 (patch)
tree61e0a5cc6284c4e8dc138385da6329f2b8e83e0f /perl-install/detect_devices.pm
parent90f7bb2359c71498b66bf6eb4ed764671816ace6 (diff)
downloaddrakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.gz
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.bz2
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.xz
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.zip
no_comment
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 327f12754..b8e9c9993 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -29,6 +29,11 @@ sub get {
}
sub hds() { grep { $_->{type} eq 'hd' } get(); }
sub cdroms() { grep { $_->{type} eq 'cdrom' } get(); }
+sub floppies() {
+ my @l = grep { $_->{type} eq 'fd' } get();
+ unshift @l, "fd0" if tryOpen("fd0");
+ @l;
+}
sub hasSCSI() {
defined $scsiDeviceAvailable and return $scsiDeviceAvailable;
@@ -143,3 +148,8 @@ sub hasPlip() { goto &getPlip }
sub hasEthernet() { hasNetDevice("eth0"); }
sub hasTokenRing() { hasNetDevice("tr0"); }
sub hasNetDevice($) { c::hasNetDevice($_[0]) }
+
+sub tryOpen($) {
+ local *F;
+ sysopen F, "/dev/$_[0]", c::O_NONBLOCK();
+}