1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Fix readcd -scanbus work.

PR:		ports/91763
Submitted by:	Fabian Keil <freebsd-listen@fabiankeil.de>
This commit is contained in:
Andrey Slusar 2006-01-15 17:08:04 +00:00
parent 7989d9cb5d
commit a486ccb0e5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=153577
4 changed files with 64 additions and 2 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= cdrtools
PORTVERSION= 2.01.01a03
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= sysutils audio
MASTER_SITES= ftp://ftp.berlios.de/pub/cdrecord/alpha/ \

View File

@ -0,0 +1,31 @@
--- readcd/readcd.c.original Sun Jan 15 17:14:03 2006
+++ readcd/readcd.c Sun Jan 15 17:24:47 2006
@@ -370,6 +370,8 @@
exit(err);
}
} else {
+ char errstr[80];
+
if (scsibus == -1 && target >= 0 && lun >= 0)
scsibus = 0;
@@ -378,8 +380,17 @@
scgp->kdebug = kdebug;
scg_settarget(scgp, scsibus, target, lun);
- if (scg__open(scgp, NULL) <= 0)
- comerr("Cannot open SCSI driver.\n");
+
+ scgp = scg_open(dev, errstr, sizeof(errstr), 0, 0);
+
+ if (scgp == NULL) {
+ errmsg("%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":"");
+ errmsgno(EX_BAD, "For possible targets try 'readcd -scanbus'.%s\n",
+ geteuid() ? " Make sure you are root.":"");
+ errmsgno(EX_BAD, "For possible transport specifiers try 'readcd dev=help'.\n");
+ exit(EX_BAD);
+ }
+
}
scgp->silent = silent;
scgp->verbose = verbose;

View File

@ -7,7 +7,7 @@
PORTNAME= cdrtools
PORTVERSION?= 2.01
PORTREVISION?= 1
PORTREVISION?= 2
CATEGORIES?= sysutils audio
MASTER_SITES= ftp://ftp.berlios.de/pub/cdrecord/ \
ftp://ftp.cs.tu-berlin.de/pub/misc/cdrecord/

View File

@ -0,0 +1,31 @@
--- readcd/readcd.c.original Sun Jan 15 17:14:03 2006
+++ readcd/readcd.c Sun Jan 15 17:24:47 2006
@@ -370,6 +370,8 @@
exit(err);
}
} else {
+ char errstr[80];
+
if (scsibus == -1 && target >= 0 && lun >= 0)
scsibus = 0;
@@ -378,8 +380,17 @@
scgp->kdebug = kdebug;
scg_settarget(scgp, scsibus, target, lun);
- if (scg__open(scgp, NULL) <= 0)
- comerr("Cannot open SCSI driver.\n");
+
+ scgp = scg_open(dev, errstr, sizeof(errstr), 0, 0);
+
+ if (scgp == NULL) {
+ errmsg("%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":"");
+ errmsgno(EX_BAD, "For possible targets try 'readcd -scanbus'.%s\n",
+ geteuid() ? " Make sure you are root.":"");
+ errmsgno(EX_BAD, "For possible transport specifiers try 'readcd dev=help'.\n");
+ exit(EX_BAD);
+ }
+
}
scgp->silent = silent;
scgp->verbose = verbose;