diff options
Diffstat (limited to 'audio/cdparanoia/patches/patch-cf')
-rw-r--r-- | audio/cdparanoia/patches/patch-cf | 86 |
1 files changed, 60 insertions, 26 deletions
diff --git a/audio/cdparanoia/patches/patch-cf b/audio/cdparanoia/patches/patch-cf index 9c809695bd7..2b7d6696217 100644 --- a/audio/cdparanoia/patches/patch-cf +++ b/audio/cdparanoia/patches/patch-cf @@ -1,8 +1,8 @@ -$NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ +$NetBSD: patch-cf,v 1.3 2002/03/04 14:45:14 itohy Exp $ ---- interface/scan_devices.c.orig Tue Dec 14 08:30:23 1999 -+++ interface/scan_devices.c Thu Jun 22 02:36:44 2000 -@@ -17,6 +17,8 @@ +--- interface/scan_devices.c.orig Mon Mar 26 14:44:01 2001 ++++ interface/scan_devices.c Mon Mar 4 00:23:01 2002 +@@ -19,6 +19,8 @@ #include "common_interface.h" #include "utils.h" @@ -10,11 +10,11 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ + #define MAX_DEV_LEN 20 /* Safe because strings only come from below */ /* must be absolute paths! */ - static char *scsi_cdrom_prefixes[3]={"/dev/scd","/dev/sr",NULL}; -@@ -28,10 +30,12 @@ - /* "/dev/aztcd", timeout is too long */ - "/dev/cm206cd", - "/dev/gscd","/dev/optcd",NULL}; + static char *scsi_cdrom_prefixes[]={ +@@ -49,10 +51,12 @@ + "/dev/cm206cd", + "/dev/gscd", + "/dev/optcd",NULL}; +#endif /* Functions here look for a cdrom drive; full init of a drive type @@ -24,7 +24,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages){ /* Brute force... */ -@@ -78,6 +82,16 @@ +@@ -98,6 +102,16 @@ } return(NULL); } @@ -41,7 +41,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ cdrom_drive *cdda_identify(const char *device, int messagedest,char **messages){ struct stat st; -@@ -143,6 +157,7 @@ +@@ -146,6 +160,7 @@ cdrom_drive *cdda_identify_cooked(const char *dev, int messagedest, char **messages){ @@ -49,7 +49,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ cdrom_drive *d=NULL; struct stat st; int fd=-1; -@@ -270,6 +285,12 @@ +@@ -273,6 +288,12 @@ idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); return(d); @@ -63,8 +63,8 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ struct sg_id { @@ -289,12 +310,18 @@ - /* Even *this* isn't as simple as it bloody well should be :-P */ + /* SG has an easy interface, but SCSI overall does not */ static int get_scsi_id(int fd, scsiid *id){ +#ifdef __linux__ struct sg_id argid; @@ -95,7 +95,23 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ return(0); } -@@ -410,6 +444,7 @@ +@@ -401,6 +435,7 @@ + strcat(a," "); + } + ++#ifdef __linux__ + /* At this point, we're going to punt compatability before SG2, and + allow only SG2 and SG3 */ + static int verify_SG_version(cdrom_drive *d,int messagedest, +@@ -430,6 +465,7 @@ + idmessage(messagedest,messages,buffer,""); + return(major); + } ++#endif + + cdrom_drive *cdda_identify_scsi(const char *generic_device, + const char *ioctl_device, int messagedest, +@@ -460,6 +496,7 @@ generic_device); return(NULL); } @@ -103,7 +119,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ if((int)(g_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){ if((int)(g_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a SCSI device", -@@ -421,6 +456,7 @@ +@@ -471,6 +508,7 @@ ioctl_device=temp; } } @@ -111,7 +127,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ } if(ioctl_device){ if(stat(ioctl_device,&i_st)){ -@@ -428,6 +464,7 @@ +@@ -478,6 +516,7 @@ ioctl_device); return(NULL); } @@ -119,7 +135,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ if((int)(i_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){ if((int)(i_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a SCSI device", -@@ -439,6 +476,7 @@ +@@ -489,6 +528,7 @@ ioctl_device=temp; } } @@ -127,15 +143,15 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ } /* we need to resolve any symlinks for the lookup code to work */ -@@ -455,6 +493,7 @@ +@@ -505,6 +545,7 @@ } if(!generic_device || !ioctl_device){ +#ifdef __linux__ if(generic_device){ - ioctl_device=scsi_match(generic_device,scsi_cdrom_prefixes,O_RDWR, - O_RDONLY|O_NONBLOCK, -@@ -468,6 +507,9 @@ + ioctl_device= + scsi_match(generic_device,scsi_cdrom_prefixes, +@@ -520,6 +561,9 @@ if(!generic_device) goto cdda_identify_scsi_fail; } @@ -145,7 +161,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ } idmessage(messagedest,messages,"\t\tgeneric device: %s",generic_device); -@@ -504,6 +546,7 @@ +@@ -556,6 +600,7 @@ type=(int)(i_st.st_rdev>>8); @@ -153,7 +169,7 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ if(type==SCSI_CDROM_MAJOR){ if (!S_ISBLK(i_st.st_mode)) { idmessage(messagedest,messages,"\t\tSCSI CDROM device %s not a " -@@ -515,8 +558,10 @@ +@@ -567,8 +612,10 @@ "major number",ioctl_device); goto cdda_identify_scsi_fail; } @@ -164,17 +180,35 @@ $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ if((int)(g_st.st_rdev>>8)==SCSI_GENERIC_MAJOR){ if (!S_ISCHR(g_st.st_mode)) { idmessage(messagedest,messages,"\t\tGeneric SCSI device %s not a " -@@ -528,6 +573,7 @@ +@@ -580,6 +627,7 @@ "major number",generic_device); goto cdda_identify_scsi_fail; } +#endif + d=calloc(1,sizeof(cdrom_drive)); +@@ -590,6 +638,7 @@ + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; + ++#ifdef __linux__ + version=verify_SG_version(d,messagedest,messages); + switch(version){ + case -1:case 0:case 1: +@@ -599,6 +648,9 @@ + d->interface=GENERIC_SCSI; + break; + } ++#else ++ d->interface=GENERIC_SCSI; ++#endif -@@ -564,7 +610,16 @@ + /* malloc our big buffer for scsi commands */ + d->sg=malloc(MAX_BIG_BUFF_SIZE); +@@ -617,7 +669,16 @@ - /* It would seem some TOSHIBA CDROM gets things wrong */ + /* It would seem some TOSHIBA CDROMs gets things wrong */ - if (!strncmp (p + 8, "TOSHIBA", 7) && +#ifndef TYPE_DISK |