From e59e99cc192c59337932fd0f033ab5b18dc180c4 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Mon, 7 Nov 1994 01:14:57 +0000 Subject: 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. --- audio/xcdplayer/files/cdrom_freebsd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'audio/xcdplayer') diff --git a/audio/xcdplayer/files/cdrom_freebsd.c b/audio/xcdplayer/files/cdrom_freebsd.c index c65d2571b18c..d723b81b36a9 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); -- cgit v1.2.3