51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
--- toconf.c.orig Sat Jan 2 00:57:42 1999
|
|
+++ toconf.c Mon Aug 23 08:50:20 1999
|
|
@@ -175,6 +175,14 @@
|
|
if (!(toconf = (toconf_entry *) realloc(toconf,
|
|
sizeof(toconf_entry) * toconf_num)))
|
|
out_of_memory();
|
|
+ /*
|
|
+ * Backward compatibility, accept tosharc entries without the
|
|
+ * ATAPI flag.
|
|
+ */
|
|
+ if (*cptr == '0' || *cptr == '1')
|
|
+ toconf[cn].atapi = readbool(&cptr, "atapi", &fs);
|
|
+ else
|
|
+ toconf[cn].atapi = 0;
|
|
toconf[cn].vendor = readstring(&cptr, "vendor", &fs);
|
|
toconf[cn].product = readstring(&cptr, "product", &fs);
|
|
toconf[cn].version = readstring(&cptr, "version", &fs);
|
|
@@ -257,7 +265,7 @@
|
|
|
|
toconf_entry *
|
|
toconf_searchentry
|
|
- (const char *vendor, const char *product, const char *version)
|
|
+ (const char *vendor, const char *product, const char *version, int atapi)
|
|
{
|
|
toconf_entry *te;
|
|
int i, l1, l2, l3;
|
|
@@ -267,18 +275,20 @@
|
|
l1 = strlen(te->vendor);
|
|
l2 = strlen(te->product);
|
|
l3 = strlen(te->version);
|
|
- if (!l1 && !l2 && !l3) {
|
|
+ if (te->atapi == atapi && !l1 && !l2 && !l3) {
|
|
fprintf (stderr, "%s: Warning: Unknown drive, "
|
|
"using default configuration!\n", me);
|
|
return te;
|
|
}
|
|
if ((!l1 || !strncmp(te->vendor, vendor, l1)) &&
|
|
(!l2 || !strncmp(te->product, product, l2)) &&
|
|
- (!l3 || !strncmp(te->version, version, l3)))
|
|
+ (!l3 || !strncmp(te->version, version, l3)) &&
|
|
+ atapi == te->atapi)
|
|
return te;
|
|
}
|
|
fprintf (stderr,
|
|
- "%s: Error: Unknown drive and missing default entry!\n", me);
|
|
+ "%s: Error: Unknown drive and missing default %s entry!\n", me,
|
|
+ atapi ? "ATAPI" : "SCSI");
|
|
exit (1);
|
|
}
|
|
|