summaryrefslogtreecommitdiffstats
path: root/audio/xcdplayer
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1994-11-07 01:14:57 +0000
committergibbs <gibbs@FreeBSD.org>1994-11-07 01:14:57 +0000
commitab8a64c8fc2cc67a5f7982703b4e74ec047edd3c (patch)
tree59d7291ce30f79061b84f397c22b512c60edaf6c /audio/xcdplayer
parentaefcba8063b28c2e773d497db507f1d83b6cea76 (diff)
downloadFreeBSD-ports-ab8a64c8fc2cc67a5f7982703b4e74ec047edd3c.zip
FreeBSD-ports-ab8a64c8fc2cc67a5f7982703b4e74ec047edd3c.tar.gz
Make the eject function work. This requires using the CDIOCALLOW ioctl
before the CDIOCEJECT ioctl otherwise the media is still locked when you attempt the eject. The previous code may have worked on drives that did not support the media lock feature.
Diffstat (limited to 'audio/xcdplayer')
-rw-r--r--audio/xcdplayer/files/cdrom_freebsd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/audio/xcdplayer/files/cdrom_freebsd.c b/audio/xcdplayer/files/cdrom_freebsd.c
index c65d257..d723b81 100644
--- a/audio/xcdplayer/files/cdrom_freebsd.c
+++ b/audio/xcdplayer/files/cdrom_freebsd.c
@@ -174,6 +174,11 @@ cdrom_eject() {
if (cdrom_fd == -1)
return(-1);
+ if (ioctl(cdrom_fd, CDIOCALLOW) == -1) {
+ perror("ioctl(cdromallow)");
+ return(-1);
+ }
+
if (ioctl(cdrom_fd, CDIOCEJECT) == -1) {
perror("ioctl(cdromeject)");
return(-1);
OpenPOWER on IntegriCloud