summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-09 17:33:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-09 17:33:59 +0000
commitb87a0f41b1d394c9972ceda81092ac8a1e60cde9 (patch)
tree5e34e4e64d0309b7a75616ff64141cb69707881c /perl-install/install_any.pm
parentbb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0 (diff)
downloaddrakx-backup-do-not-use-b87a0f41b1d394c9972ceda81092ac8a1e60cde9.tar
drakx-backup-do-not-use-b87a0f41b1d394c9972ceda81092ac8a1e60cde9.tar.gz
drakx-backup-do-not-use-b87a0f41b1d394c9972ceda81092ac8a1e60cde9.tar.bz2
drakx-backup-do-not-use-b87a0f41b1d394c9972ceda81092ac8a1e60cde9.tar.xz
drakx-backup-do-not-use-b87a0f41b1d394c9972ceda81092ac8a1e60cde9.zip
(ejectCdrom): fix D state on exit
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 56f469594..55500ba91 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -479,10 +479,13 @@ sub unlockCdrom(;$) {
sub ejectCdrom(;$) {
my ($cdrom) = @_;
getFile("XXX"); #- close still opened filehandle
- $cdrom or cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1;
- my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return;
- eval { fs::umount("/tmp/image") };
- ioctl $f, c::CDROMEJECT(), 1;
+ $cdrom ||= $1 if cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image),;
+ if ($cdrom) {
+ #- umount BEFORE opening the cdrom device otherwise the umount will
+ #- D state if the cdrom is already removed
+ eval { fs::umount("/tmp/image") };
+ eval { ioctl detect_devices::tryOpen($cdrom), c::CDROMEJECT(), 1 };
+ }
}
sub setupFB {