summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-28 16:42:40 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-28 16:42:40 +0000
commit6a9076129c48496af1f17905d53f15427aa5e341 (patch)
tree1146e92c215862e3cfbac7d2bc39b13cab81976f /mdk-stage1
parent1a37fd3b14680f6890102bf0e3ff4498a7443362 (diff)
downloaddrakx-6a9076129c48496af1f17905d53f15427aa5e341.tar
drakx-6a9076129c48496af1f17905d53f15427aa5e341.tar.gz
drakx-6a9076129c48496af1f17905d53f15427aa5e341.tar.bz2
drakx-6a9076129c48496af1f17905d53f15427aa5e341.tar.xz
drakx-6a9076129c48496af1f17905d53f15427aa5e341.zip
we still can't eject. try to shotgun a bit.
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c
index 73e82bd7d..5209f1f50 100644
--- a/mdk-stage1/init.c
+++ b/mdk-stage1/init.c
@@ -336,9 +336,26 @@ void unmount_filesystems(void)
fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0);
if (fd > 0) {
ioctl(fd, CDROM_LOCKDOOR, 0);
+ close(fd);
+ }
+ fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0);
+ if (fd > 0) {
+ if (!ioctl(fd, CDROMEJECT, 0))
+ goto ejected;
+ close(fd);
+ }
+ fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0);
+ if (fd > 0) {
+ ioctl(fd, CDROM_LOCKDOOR, 0);
+ close(fd);
+ }
+ fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0);
+ if (fd > 0) {
ioctl(fd, CDROMEJECT, 0);
close(fd);
}
+ ejected:
+ close(fd);
}
#endif