diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-08-28 10:19:54 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-08-28 10:19:54 +0000 |
commit | 2d3b13d3b7e6f08f6310467ece7d399c5858d233 (patch) | |
tree | 61e0a5cc6284c4e8dc138385da6329f2b8e83e0f /perl-install/detect_devices.pm | |
parent | 90f7bb2359c71498b66bf6eb4ed764671816ace6 (diff) | |
download | drakx-backup-do-not-use-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar drakx-backup-do-not-use-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.gz drakx-backup-do-not-use-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.bz2 drakx-backup-do-not-use-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.xz drakx-backup-do-not-use-2d3b13d3b7e6f08f6310467ece7d399c5858d233.zip |
no_comment
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 10 |
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(); +} |