openbsd-ports/audio/tosha/patches/patch-tosha_c

28 lines
1.1 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-tosha_c,v 1.1 2001/03/14 15:04:12 naddy Exp $
1999-08-23 03:22:09 -04:00
--- tosha.c.orig Sat Jan 2 00:57:49 1999
+++ tosha.c Wed Mar 14 15:23:38 2001
@@ -578,6 +578,7 @@ main (int argc, char *argv[])
1999-08-23 03:22:09 -04:00
int i;
char *vendor, *product, *versid;
+ int atapi;
char *ofname; /* output file name */
int index;
int singlefile = FALSE;
@@ -634,10 +635,12 @@ main (int argc, char *argv[])
1999-08-23 03:22:09 -04:00
vendor = justify(strndup((char *) buf + 8, 8));
product = justify(strndup((char *) buf + 16, 16));
versid = justify(strndup((char *) buf + 32, 4));
+ /* SID_ANSII field is 0 on ATAPI devices. XXX get SID_ANSII define? */
+ atapi = (buf[2] & 7) == 0;
if (!quiet)
- fprintf (stderr, "Device: %s -- \"%s\" \"%s\" \"%s\"\n",
- device, vendor, product, versid);
- devconfig = toconf_searchentry(vendor, product, versid);
+ fprintf (stderr, "%s device: %s -- \"%s\" \"%s\" \"%s\"\n",
+ atapi ? "ATAPI" : "SCSI", device, vendor, product, versid);
+ devconfig = toconf_searchentry(vendor, product, versid, atapi);
if (sectorsperbuf <= 0)
sectorsperbuf = devconfig->blocks;
else