1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

Avoids bus errors by closing and re-initializing the device before we

try to re-open it.

PR:		20979
Submitted by:	Orion Hodson <O.Hodson@cs.ucl.ac.uk>
This commit is contained in:
Steve Price 2000-09-05 01:33:44 +00:00
parent 8f94940be7
commit 378999b03e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=32272
3 changed files with 39 additions and 0 deletions

10
audio/grip/files/patch-ab Normal file
View File

@ -0,0 +1,10 @@
--- grip.h.orig Tue Apr 18 10:37:44 2000
+++ grip.h Mon Sep 4 17:59:26 2000
@@ -257,6 +257,7 @@
/* Low-level cd control routines -- found in cd.c */
int CDInitDevice(char *device_name);
+void CDCloseDevice(int cd_desc);
int CDStat(int cd_desc,struct disc_info *disc,gboolean read_toc);
int CDPlayFrames(int cd_desc,int startframe,int endframe);
int CDPlayTrackPos(int cd_desc,struct disc_info *disc,int starttrack,

14
audio/grip/files/patch-ac Normal file
View File

@ -0,0 +1,14 @@
--- cd.c.orig Tue Apr 18 10:37:44 2000
+++ cd.c Mon Sep 4 17:59:26 2000
@@ -98,6 +98,11 @@
return cd_desc;
}
+void CDCloseDevice(int cd_desc)
+{
+ close(cd_desc);
+}
+
/* Update a CD status structure... because operating system interfaces vary
so does this function. */

15
audio/grip/files/patch-ad Normal file
View File

@ -0,0 +1,15 @@
--- grip.c.orig Tue Apr 18 10:37:44 2000
+++ grip.c Mon Sep 4 17:59:26 2000
@@ -1279,6 +1279,12 @@
CDStat(cd_desc,&info,FALSE);
if(info.disc_present) {
+ /* FreeBSD CD ioctl CDIOREADTOCHEADER fails when old disk is ejected
+ * and a new disk one entered. Re-opening device fixes this.
+ */
+ CDCloseDevice(cd_desc);
+ cd_desc = CDInitDevice(cddevice);
+
CDStat(cd_desc,&info,TRUE);
Debug("CDStat found a disc, checking tracks\n");