summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index f35dc8a06..2ba152c82 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -546,7 +546,10 @@ sub ejectCdrom(;$) {
#- D state if the cdrom is already removed
eval { fs::umount("/tmp/image") };
if ($@) { log::l("files still open: ", readlink($_)) foreach map { glob_("$_/fd/*") } glob_("/proc/*") }
- eval { ioctl detect_devices::tryOpen($cdrom), c::CDROMEJECT(), 1 };
+ eval {
+ my $dev = detect_devices::tryOpen($cdrom);
+ ioctl($dev, c::CDROMEJECT(), 1) if ioctl($dev, c::CDROM_DRIVE_STATUS(), 0) == c::CDS_DISC_OK();
+ };
}
}