[Debburn-changes] r569 - in cdrkit/trunk: doc libusal wodim

Eduard Bloch blade at alioth.debian.org
Thu Dec 7 00:29:33 CET 2006


Author: blade
Date: 2006-12-07 00:29:31 +0100 (Thu, 07 Dec 2006)
New Revision: 569

Added:
   cdrkit/trunk/doc/WHY
Modified:
   cdrkit/trunk/libusal/scsi-linux-sg.c
   cdrkit/trunk/wodim/scsi_scan.c
   cdrkit/trunk/wodim/wodim.c
Log:
Some usefull information for users (using the terms of some other person)

Added: cdrkit/trunk/doc/WHY
===================================================================
--- cdrkit/trunk/doc/WHY	2006-12-06 23:14:05 UTC (rev 568)
+++ cdrkit/trunk/doc/WHY	2006-12-06 23:29:31 UTC (rev 569)
@@ -0,0 +1,26 @@
+Why cdrkit? Why wodim? Why genisoimage? Because:
+
+ - it won't tell you that you have no /dev/pg* device file thing foo, that you
+   have never seen and you will never need
+ 
+ - it won't require to be executed as root, fail with obscure messages without
+   such permissions
+
+ - it won't force you to wait 3 seconds every time you want to start, no matter
+   what you specify as gracetime=
+ 
+ - it won't kill another burning process when you do -scanbus in another shell
+
+ - it will let you specify your device directly in the way you know it, rather
+   than forcing some weird TARGET,BUS,LUN syntax with weird numbers
+ 
+ - it will not wreak random havoc if you used spaces and not tabs in the config file
+
+ - genisoimage won't stop accepting the well known option -L in the near future
+
+ - genisoimage will stop on 2.1GiB large files rather than just "forgetting"
+   them and let you burn crap
+ 
+ - users are respected and not used as pinballs between us and the OS kernel
+   developers
+

Modified: cdrkit/trunk/libusal/scsi-linux-sg.c
===================================================================
--- cdrkit/trunk/libusal/scsi-linux-sg.c	2006-12-06 23:14:05 UTC (rev 568)
+++ cdrkit/trunk/libusal/scsi-linux-sg.c	2006-12-06 23:29:31 UTC (rev 569)
@@ -399,50 +399,41 @@
 		goto openbydev;
 
 scanopen:
-	/*
-	 * Note that it makes no sense to scan less than all /dev/hd* devices
-	 * as even /dev/hda may be a device that talks SCSI (e.g. a ATAPI
-	 * notebook disk or a CD/DVD writer). The CD/DVD writer case may
-	 * look silly but there may be users that did boot from a SCSI hdd
-	 * and connected 4 CD/DVD writers to both IDE cables in the PC.
-	 */
-/*	if (use_ata) for (i = 0; i <= 25; i++) { */
-/* If a device was specified with ATA:x,y,z try to open this device instead of
- * uselessly opening all of them until we reach the specified one */
-	if (use_ata) for (i=2*busno+tgt >= 0 ? 2*busno+tgt:0; i <= 25; i++) {
-		snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
-					/* O_NONBLOCK is dangerous */
-		f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
-		if (f < 0) {
-			/*
-			 * Set up error string but let us clear it later
-			 * if at least one open succeeded.
-			 */
-			if (usalp->errstr)
-				snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
-							"Cannot open '/dev/hd*'");
-			if (errno != ENOENT && errno != ENXIO && errno != ENODEV) {
+	if (use_ata) {
+		for (i=2*busno+tgt >= 0 ? 2*busno+tgt:0; i <= 25; i++) {
+			snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
+			/* O_NONBLOCK is dangerous */
+			f = sg_open_excl(devname, O_RDWR | O_NONBLOCK);
+			if (f < 0) {
+				/*
+				 * Set up error string but let us clear it later
+				 * if at least one open succeeded.
+				 */
 				if (usalp->errstr)
 					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
-							"Cannot open '%s'", devname);
-				/* return (0); */
-            continue;
-			}
-		} else {
-			int	iparm;
+							"Cannot open %s", devname);
+				if (errno != ENOENT && errno != ENXIO && errno != ENODEV) {
+					if (usalp->errstr)
+						snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+								"Cannot open '%s'", devname);
+					continue;
+				}
+			} else {
+				int	iparm;
 
-			if (ioctl(f, SG_GET_TIMEOUT, &iparm) < 0) {
-				if (usalp->errstr)
-					snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
-							"SCSI unsupported with '/dev/hd*'");
-				close(f);
-				continue;
+				if (ioctl(f, SG_GET_TIMEOUT, &iparm) < 0) {
+					if (usalp->errstr)
+						snprintf(usalp->errstr, SCSI_ERRSTR_SIZE,
+								"SCSI unsupported with %s", devname);
+					close(f);
+					continue;
+				}
+				sg_clearnblock(f);	/* Be very proper about this */
+				if (sg_setup(usalp, f, busno, tgt, tlun, i))
+					return (++nopen);
+				if (busno < 0 && tgt < 0 && tlun < 0)
+					nopen++;
 			}
-			sg_clearnblock(f);	/* Be very proper about this */
-			if (sg_setup(usalp, f, busno, tgt, tlun, i))
-				return (++nopen);
-			if (busno < 0 && tgt < 0 && tlun < 0)
-				nopen++;
 		}
 	}
 	if (use_ata && nopen == 0)

Modified: cdrkit/trunk/wodim/scsi_scan.c
===================================================================
--- cdrkit/trunk/wodim/scsi_scan.c	2006-12-06 23:14:05 UTC (rev 568)
+++ cdrkit/trunk/wodim/scsi_scan.c	2006-12-06 23:29:31 UTC (rev 569)
@@ -69,9 +69,7 @@
 	usal_fprintdev(f, ip);
 }
 
-int
-select_target(SCSI *usalp, FILE *f)
-{
+int select_target(SCSI *usalp, FILE *f) {
 	int	initiator;
 #ifdef	FMT
 	int	cscsibus = usal_scsibus(usalp);

Modified: cdrkit/trunk/wodim/wodim.c
===================================================================
--- cdrkit/trunk/wodim/wodim.c	2006-12-06 23:14:05 UTC (rev 568)
+++ cdrkit/trunk/wodim/wodim.c	2006-12-06 23:29:31 UTC (rev 569)
@@ -3731,7 +3731,7 @@
 	}
 	if (*flagsp & (F_LOAD|F_DLCK|F_SETDROPTS|F_MSINFO|F_TOC|F_PRATIP|F_FIX|F_VERSION|F_CHECKDRIVE|F_PRCAP|F_INQUIRY|F_SCANBUS|F_RESET|F_ABORT)) {
 		if (tracks != 0) {
-       printf(stderr,
+       fprintf(stderr,
              "No tracks allowed with -load, -lock, -setdropts, -msinfo, -toc, -atip, -fix,\n"
              "-version, -checkdrive, -prcap, -inq, -scanbus, -reset and -abort options.\n" );
        exit(EXIT_FAILURE);




More information about the Debburn-changes mailing list