[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cdrtools-2.01.01a09 released



Following up on my own mail written recently:

> This doesn't change my earlier assertion that the Linux ATA/SCSI split
> that Jörg complains so heftily about is an entirely artificial libscg
> limit, as proven by the patches Jörg refused to look at at their time.

People might find it interesting that Jörg replied "*PLONK*" in a
personal message to this paragraph.  It appears as though Jörg isn't
capable of a factual discussion (this was attempted earlier this year on
linux-kernel and failed, too).

The patches were posted to linux-kernel several weeks ago, Jörg refused
to look at them and instead defamed the patch as breaking things. I have
since updated the patch for a09, and it is now under the CDDL 1.0,
governed by the laws of Germany, court of jurisdiction Hagen/Westf.

And to show these aren't just hollow sounds, here goes the patch, so
it's archived by the pertinent lists as well.

To apply against 2.01.01a09 with patch -p0.

As usual, no warranties; use at your own risk. In case it's more
convenient for some mailers or archives or user handling, it's attached
(same thing).

=== cdrecord/cdrecord.c
==================================================================
--- cdrecord/cdrecord.c	(/cdrtools/vendor)	(revision 17)
+++ cdrecord/cdrecord.c	(/cdrtools/ma)	(revision 17)
@@ -58,7 +58,7 @@
 #include "movesect.h"
 
 
-char	cdr_version[] = "2.01.01a09";
+char	cdr_version[] = "2.01.01a09ma1";
 
 #if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING -0 >= 0
 #ifdef  HAVE_SYS_PRIOCNTL_H	/* The preferred SYSvR4 schduler */
@@ -242,7 +242,6 @@
 LOCAL	void	print_wrmodes	__PR((cdr_t *dp));
 LOCAL	BOOL	check_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
 LOCAL	void	set_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
-LOCAL	void	linuxcheck	__PR((void));
 
 struct exargs {
 	SCSI	*scgp;
@@ -351,17 +350,20 @@
 #	define	CLONE_TITLE	""
 #endif
 	if ((flags & F_MSINFO) == 0 || lverbose || flags & F_VERSION) {
-		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2006 Jörg Schilling\n",
+		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2006 Joerg Schilling, 2006 Matthias Andree\n",
 								PRODVD_TITLE,
 								CLONE_TITLE,
 								cdr_version,
 								HOST_CPU, HOST_VENDOR, HOST_OS);
 
+#define SOURCE_MODIFIED 1
+
 #if	defined(SOURCE_MODIFIED) || !defined(IS_SCHILY_XCONFIG)
-#define	INSERT_YOUR_EMAIL_ADDRESS_HERE
+#define	INSERT_YOUR_EMAIL_ADDRESS_HERE "matthias.andree@gmx.de"
 #define	NO_SUPPORT	0
 		printf("NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord\n");
-		printf("      and thus may have bugs that are not present in the original version.\n");
+		printf("      that removed some bogus whining of the original author. Although unlikely,\n");
+		printf("      it may have bugs that are not present in the original version.\n");
 #if	NO_SUPPORT
 		printf("      The author of the modifications decided not to provide a support e-mail\n");
 		printf("      address so there is absolutely no support for this version.\n");
@@ -379,19 +381,6 @@
 #endif
 	}
 
-	/*
-	 * I am sorry that even for version 1.313 of cdrecord.c, I am forced to do
-	 * things like this, but defective versions of cdrecord cause a lot of
-	 * work load to me.
-	 *
-	 * Note that the intention to have non bastardized versions.
-	 *
-	 * It is bad to see that in special in the "Linux" business, companies
-	 * prefer a model with many proprietary differing programs
-	 * instead of cooperating with the program authors.
-	 */
-	linuxcheck();	/* For version 1.313 of cdrecord.c */
-
 	if (flags & F_VERSION)
 		exit(0);
 	/*
@@ -4749,57 +4738,3 @@
 	}
 	dsp->ds_wrmode = WM_NONE;
 }
-
-/*
- * I am sorry that even for version 1.313 of cdrecord.c, I am forced to do
- * things like this, but defective versions of cdrecord cause a lot of
- * work load to me.
- *
- * Note that the intention to have non bastardized versions.
- *
- * It is bad to see that in special in the "Linux" business, companies
- * prefer a model with many proprietary differing programs
- * instead of cooperating with the program authors.
- */
-#if	defined(linux) || defined(__linux) || defined(__linux__)
-#ifdef	HAVE_UNAME
-#include <sys/utsname.h>
-#endif
-#endif
-
-LOCAL void
-linuxcheck()				/* For version 1.313 of cdrecord.c */
-{
-#if	defined(linux) || defined(__linux) || defined(__linux__)
-#ifdef	HAVE_UNAME
-	struct	utsname	un;
-
-	if (uname(&un) >= 0) {
-		/*
-		 * I really hope that the Linux kernel developers will soon
-		 * fix the most annoying bugs (as promised). Linux-2.6.8
-		 * has still much more reported problems than Linux-2.4.
-		 */
-		if ((un.release[0] == '2' && un.release[1] == '.') &&
-		    (un.release[2] == '5' || un.release[2] == '6')) {
-			errmsgno(EX_BAD,
-			"Warning: Running on Linux-%s\n", un.release);
-			errmsgno(EX_BAD,
-			"There are unsettled issues with Linux-2.5 and newer.\n");
-			errmsgno(EX_BAD,
-			"If you have unexpected problems, please try Linux-2.4 or Solaris.\n");
-		}
-		if ((un.release[0] == '2' && un.release[1] == '.') &&
-		    (un.release[2] > '6' ||
-		    (un.release[2] == '6' && un.release[3] == '.' && un.release[4] >= '8'))) {
-			errmsgno(EX_BAD,
-			"Warning: Linux-2.6.8 introduced incompatible interface changes.\n");
-			errmsgno(EX_BAD,
-			"Warning: SCSI transport does no longer work for suid root programs.\n");
-			errmsgno(EX_BAD,
-			"Warning: if cdrecord fails, try to run it from a root account.\n");
-		}
-	}
-#endif
-#endif
-}
=== libscg/scsi-linux-sg.c
==================================================================
--- libscg/scsi-linux-sg.c	(/cdrtools/vendor)	(revision 17)
+++ libscg/scsi-linux-sg.c	(/cdrtools/ma)	(revision 17)
@@ -125,7 +125,7 @@
  *	Choose your name instead of "schily" and make clear that the version
  *	string is related to a modified source.
  */
-LOCAL	char	_scg_trans_version[] = "scsi-linux-sg.c-1.86";	/* The version for this transport*/
+LOCAL	char	_scg_trans_version[] = "scsi-linux-sg.c-1.86+ma";	/* The version for this transport*/
 
 #ifndef	SCSI_IOCTL_GET_BUS_NUMBER
 #define	SCSI_IOCTL_GET_BUS_NUMBER 0x5386
@@ -278,7 +278,7 @@
 		 * return "schily" for the SCG_AUTHOR request.
 		 */
 		case SCG_AUTHOR:
-			return (_scg_auth_schily);
+			return ("");
 		case SCG_SCCS_ID:
 			return (__sccsid);
 		case SCG_KVERSION:
@@ -313,8 +313,6 @@
 #ifdef	USE_ATA
 	scgo_ahelp(scgp, f);
 #endif
-	__scg_help(f, "ATA", "ATA Packet specific SCSI transport using sg interface",
-		"ATA:", "bus,target,lun", "1,2,0", TRUE, FALSE);
 	return (0);
 }
 
@@ -333,7 +331,6 @@
 	register int	l;
 	register int	nopen = 0;
 	char		devname[64];
-		BOOL	use_ata = FALSE;
 
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
@@ -343,44 +340,14 @@
 				busno, tgt, tlun);
 		return (-1);
 	}
-	if (device != NULL && *device != '\0') {
 #ifdef	USE_ATA
+	if (device != NULL && *device != '\0') {
 		if (strncmp(device, "ATAPI", 5) == 0) {
 			scgp->ops = &ata_ops;
 			return (SCGO_OPEN(scgp, device));
 		}
-#endif
-		if (strcmp(device, "ATA") == 0) {
-			/*
-			 * Sending generic SCSI commands via /dev/hd* is a
-			 * really bad idea when there also is a generic
-			 * SCSI driver interface - it breaks the protocol
-			 * layering model. A better idea would be to
-			 * have a SCSI host bus adapter driver that sends
-			 * the SCSI commands via the ATA hardware. This way,
-			 * the layering model would be honored.
-			 *
-			 * People like Jens Axboe should finally fix the DMA
-			 * bugs in the ide-scsi hostadaptor emulation module
-			 * from Linux instead of publishing childish patches
-			 * to the comment above.
-			 */
-			use_ata = TRUE;
-			device = NULL;
-			if (scgp->overbose) {
-				/*
-				 * I strongly encourage people who believe that
-				 * they need to patch this message away to read
-				 * the messages in the Solaris USCSI libscg
-				 * layer instead of wetting their tissues while
-				 * being unwilling to look besides their
-				 * own belly button.
-				 */
-				js_fprintf((FILE *)scgp->errfile,
-				"Warning: Using badly designed ATAPI via /dev/hd* interface.\n");
-			}
-		}
 	}
+#endif
 
 	if (scgp->local == NULL) {
 		scgp->local = malloc(sizeof (struct scg_local));
@@ -394,8 +361,6 @@
 		scglocal(scgp)->drvers = -1;
 		scglocal(scgp)->isold = -1;
 		scglocal(scgp)->flags = 0;
-		if (use_ata)
-			scglocal(scgp)->flags |= LF_ATA;
 		scglocal(scgp)->xbufsize = 0L;
 		scglocal(scgp)->xbuf = NULL;
 
@@ -408,13 +373,9 @@
 		}
 	}
 
-	if (use_ata)
-		goto scanopen;
-
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2))
 		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
@@ -422,7 +383,7 @@
 	 * 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++) {
+	for (i = 0; i <= 25; i++) {
 		js_snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
 					/* O_NONBLOCK is dangerous */
 		f = open(devname, O_RDWR | O_NONBLOCK);
@@ -438,7 +399,7 @@
 				if (scgp->errstr)
 					js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
-				return (0);
+				continue;
 			}
 		} else {
 			int	iparm;
@@ -451,18 +412,18 @@
 				continue;
 			}
 			sg_clearnblock(f);	/* Be very proper about this */
+			scglocal(scgp)->flags |= LF_ATA;
 			if (sg_setup(scgp, f, busno, tgt, tlun, i))
 				return (++nopen);
 			if (busno < 0 && tgt < 0 && tlun < 0)
 				nopen++;
 		}
 	}
-	if (use_ata && nopen == 0)
-		return (0);
+
 	if (nopen > 0 && scgp->errstr)
 		scgp->errstr[0] = '\0';
 
-	if (nopen == 0) for (i = 0; i < 32; i++) {
+	for (i = 0; i < 32; i++) {
 		js_snprintf(devname, sizeof (devname), "/dev/sg%d", i);
 					/* O_NONBLOCK is dangerous */
 		f = open(devname, O_RDWR | O_NONBLOCK);
@@ -478,7 +439,7 @@
 				if (scgp->errstr)
 					js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
-				return (0);
+				continue;
 			}
 		} else {
 			sg_clearnblock(f);	/* Be very proper about this */
@@ -507,7 +468,7 @@
 				if (scgp->errstr)
 					js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
-				return (0);
+				continue;
 			}
 		} else {
 			sg_clearnblock(f);	/* Be very proper about this */
@@ -528,19 +489,6 @@
 			if (b < 0 || b > 25)
 				b = -1;
 		}
-		if (scgp->overbose) {
-			/*
-			 * Before you patch this away, are you sure that you
-			 * know what you are going to to?
-			 *
-			 * Note that this is a warning that helps users from
-			 * cdda2wav, mkisofs and other programs (that
-			 * distinguish SCSI addresses from file names) from
-			 * getting unexpected results.
-			 */
-			js_fprintf((FILE *)scgp->errfile,
-			"Warning: Open by 'devname' is unintentional and not supported.\n");
-		}
 					/* O_NONBLOCK is dangerous */
 		f = open(device, O_RDWR | O_NONBLOCK);
 /*		if (f < 0 && errno == ENOENT)*/
@@ -639,12 +587,8 @@
 }
 
 /*
- * The Linux kernel becomes more and more unmaintainable.
- * Every year, a new incompatible SCSI transport interface is added.
- * Each of them has it's own contradictory constraints.
- * While you cannot have O_NONBLOCK set during operation, at least one
- * of the drivers requires O_NONBLOCK to be set during open().
- * This is used to clear O_NONBLOCK immediately after open() succeeded.
+ * This is used to clear O_NONBLOCK immediately after open() succeeded,
+ * some Linux devices appear to require O_NONBLOCK during operation.
  */
 LOCAL void
 sg_clearnblock(f)


-- 
Matthias Andree
=== cdrecord/cdrecord.c
==================================================================
--- cdrecord/cdrecord.c	(/cdrtools/vendor)	(revision 17)
+++ cdrecord/cdrecord.c	(/cdrtools/ma)	(revision 17)
@@ -58,7 +58,7 @@
 #include "movesect.h"
 
 
-char	cdr_version[] = "2.01.01a09";
+char	cdr_version[] = "2.01.01a09ma1";
 
 #if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING -0 >= 0
 #ifdef  HAVE_SYS_PRIOCNTL_H	/* The preferred SYSvR4 schduler */
@@ -242,7 +242,6 @@
 LOCAL	void	print_wrmodes	__PR((cdr_t *dp));
 LOCAL	BOOL	check_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
 LOCAL	void	set_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
-LOCAL	void	linuxcheck	__PR((void));
 
 struct exargs {
 	SCSI	*scgp;
@@ -351,17 +350,20 @@
 #	define	CLONE_TITLE	""
 #endif
 	if ((flags & F_MSINFO) == 0 || lverbose || flags & F_VERSION) {
-		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2006 Jörg Schilling\n",
+		printf("Cdrecord%s%s %s (%s-%s-%s) Copyright (C) 1995-2006 Joerg Schilling, 2006 Matthias Andree\n",
 								PRODVD_TITLE,
 								CLONE_TITLE,
 								cdr_version,
 								HOST_CPU, HOST_VENDOR, HOST_OS);
 
+#define SOURCE_MODIFIED 1
+
 #if	defined(SOURCE_MODIFIED) || !defined(IS_SCHILY_XCONFIG)
-#define	INSERT_YOUR_EMAIL_ADDRESS_HERE
+#define	INSERT_YOUR_EMAIL_ADDRESS_HERE "matthias.andree@gmx.de"
 #define	NO_SUPPORT	0
 		printf("NOTE: this version of cdrecord is an inofficial (modified) release of cdrecord\n");
-		printf("      and thus may have bugs that are not present in the original version.\n");
+		printf("      that removed some bogus whining of the original author. Although unlikely,\n");
+		printf("      it may have bugs that are not present in the original version.\n");
 #if	NO_SUPPORT
 		printf("      The author of the modifications decided not to provide a support e-mail\n");
 		printf("      address so there is absolutely no support for this version.\n");
@@ -379,19 +381,6 @@
 #endif
 	}
 
-	/*
-	 * I am sorry that even for version 1.313 of cdrecord.c, I am forced to do
-	 * things like this, but defective versions of cdrecord cause a lot of
-	 * work load to me.
-	 *
-	 * Note that the intention to have non bastardized versions.
-	 *
-	 * It is bad to see that in special in the "Linux" business, companies
-	 * prefer a model with many proprietary differing programs
-	 * instead of cooperating with the program authors.
-	 */
-	linuxcheck();	/* For version 1.313 of cdrecord.c */
-
 	if (flags & F_VERSION)
 		exit(0);
 	/*
@@ -4749,57 +4738,3 @@
 	}
 	dsp->ds_wrmode = WM_NONE;
 }
-
-/*
- * I am sorry that even for version 1.313 of cdrecord.c, I am forced to do
- * things like this, but defective versions of cdrecord cause a lot of
- * work load to me.
- *
- * Note that the intention to have non bastardized versions.
- *
- * It is bad to see that in special in the "Linux" business, companies
- * prefer a model with many proprietary differing programs
- * instead of cooperating with the program authors.
- */
-#if	defined(linux) || defined(__linux) || defined(__linux__)
-#ifdef	HAVE_UNAME
-#include <sys/utsname.h>
-#endif
-#endif
-
-LOCAL void
-linuxcheck()				/* For version 1.313 of cdrecord.c */
-{
-#if	defined(linux) || defined(__linux) || defined(__linux__)
-#ifdef	HAVE_UNAME
-	struct	utsname	un;
-
-	if (uname(&un) >= 0) {
-		/*
-		 * I really hope that the Linux kernel developers will soon
-		 * fix the most annoying bugs (as promised). Linux-2.6.8
-		 * has still much more reported problems than Linux-2.4.
-		 */
-		if ((un.release[0] == '2' && un.release[1] == '.') &&
-		    (un.release[2] == '5' || un.release[2] == '6')) {
-			errmsgno(EX_BAD,
-			"Warning: Running on Linux-%s\n", un.release);
-			errmsgno(EX_BAD,
-			"There are unsettled issues with Linux-2.5 and newer.\n");
-			errmsgno(EX_BAD,
-			"If you have unexpected problems, please try Linux-2.4 or Solaris.\n");
-		}
-		if ((un.release[0] == '2' && un.release[1] == '.') &&
-		    (un.release[2] > '6' ||
-		    (un.release[2] == '6' && un.release[3] == '.' && un.release[4] >= '8'))) {
-			errmsgno(EX_BAD,
-			"Warning: Linux-2.6.8 introduced incompatible interface changes.\n");
-			errmsgno(EX_BAD,
-			"Warning: SCSI transport does no longer work for suid root programs.\n");
-			errmsgno(EX_BAD,
-			"Warning: if cdrecord fails, try to run it from a root account.\n");
-		}
-	}
-#endif
-#endif
-}
=== libscg/scsi-linux-sg.c
==================================================================
--- libscg/scsi-linux-sg.c	(/cdrtools/vendor)	(revision 17)
+++ libscg/scsi-linux-sg.c	(/cdrtools/ma)	(revision 17)
@@ -125,7 +125,7 @@
  *	Choose your name instead of "schily" and make clear that the version
  *	string is related to a modified source.
  */
-LOCAL	char	_scg_trans_version[] = "scsi-linux-sg.c-1.86";	/* The version for this transport*/
+LOCAL	char	_scg_trans_version[] = "scsi-linux-sg.c-1.86+ma";	/* The version for this transport*/
 
 #ifndef	SCSI_IOCTL_GET_BUS_NUMBER
 #define	SCSI_IOCTL_GET_BUS_NUMBER 0x5386
@@ -278,7 +278,7 @@
 		 * return "schily" for the SCG_AUTHOR request.
 		 */
 		case SCG_AUTHOR:
-			return (_scg_auth_schily);
+			return ("");
 		case SCG_SCCS_ID:
 			return (__sccsid);
 		case SCG_KVERSION:
@@ -313,8 +313,6 @@
 #ifdef	USE_ATA
 	scgo_ahelp(scgp, f);
 #endif
-	__scg_help(f, "ATA", "ATA Packet specific SCSI transport using sg interface",
-		"ATA:", "bus,target,lun", "1,2,0", TRUE, FALSE);
 	return (0);
 }
 
@@ -333,7 +331,6 @@
 	register int	l;
 	register int	nopen = 0;
 	char		devname[64];
-		BOOL	use_ata = FALSE;
 
 	if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
 		errno = EINVAL;
@@ -343,44 +340,14 @@
 				busno, tgt, tlun);
 		return (-1);
 	}
-	if (device != NULL && *device != '\0') {
 #ifdef	USE_ATA
+	if (device != NULL && *device != '\0') {
 		if (strncmp(device, "ATAPI", 5) == 0) {
 			scgp->ops = &ata_ops;
 			return (SCGO_OPEN(scgp, device));
 		}
-#endif
-		if (strcmp(device, "ATA") == 0) {
-			/*
-			 * Sending generic SCSI commands via /dev/hd* is a
-			 * really bad idea when there also is a generic
-			 * SCSI driver interface - it breaks the protocol
-			 * layering model. A better idea would be to
-			 * have a SCSI host bus adapter driver that sends
-			 * the SCSI commands via the ATA hardware. This way,
-			 * the layering model would be honored.
-			 *
-			 * People like Jens Axboe should finally fix the DMA
-			 * bugs in the ide-scsi hostadaptor emulation module
-			 * from Linux instead of publishing childish patches
-			 * to the comment above.
-			 */
-			use_ata = TRUE;
-			device = NULL;
-			if (scgp->overbose) {
-				/*
-				 * I strongly encourage people who believe that
-				 * they need to patch this message away to read
-				 * the messages in the Solaris USCSI libscg
-				 * layer instead of wetting their tissues while
-				 * being unwilling to look besides their
-				 * own belly button.
-				 */
-				js_fprintf((FILE *)scgp->errfile,
-				"Warning: Using badly designed ATAPI via /dev/hd* interface.\n");
-			}
-		}
 	}
+#endif
 
 	if (scgp->local == NULL) {
 		scgp->local = malloc(sizeof (struct scg_local));
@@ -394,8 +361,6 @@
 		scglocal(scgp)->drvers = -1;
 		scglocal(scgp)->isold = -1;
 		scglocal(scgp)->flags = 0;
-		if (use_ata)
-			scglocal(scgp)->flags |= LF_ATA;
 		scglocal(scgp)->xbufsize = 0L;
 		scglocal(scgp)->xbuf = NULL;
 
@@ -408,13 +373,9 @@
 		}
 	}
 
-	if (use_ata)
-		goto scanopen;
-
 	if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2))
 		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
@@ -422,7 +383,7 @@
 	 * 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++) {
+	for (i = 0; i <= 25; i++) {
 		js_snprintf(devname, sizeof (devname), "/dev/hd%c", i+'a');
 					/* O_NONBLOCK is dangerous */
 		f = open(devname, O_RDWR | O_NONBLOCK);
@@ -438,7 +399,7 @@
 				if (scgp->errstr)
 					js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
-				return (0);
+				continue;
 			}
 		} else {
 			int	iparm;
@@ -451,18 +412,18 @@
 				continue;
 			}
 			sg_clearnblock(f);	/* Be very proper about this */
+			scglocal(scgp)->flags |= LF_ATA;
 			if (sg_setup(scgp, f, busno, tgt, tlun, i))
 				return (++nopen);
 			if (busno < 0 && tgt < 0 && tlun < 0)
 				nopen++;
 		}
 	}
-	if (use_ata && nopen == 0)
-		return (0);
+
 	if (nopen > 0 && scgp->errstr)
 		scgp->errstr[0] = '\0';
 
-	if (nopen == 0) for (i = 0; i < 32; i++) {
+	for (i = 0; i < 32; i++) {
 		js_snprintf(devname, sizeof (devname), "/dev/sg%d", i);
 					/* O_NONBLOCK is dangerous */
 		f = open(devname, O_RDWR | O_NONBLOCK);
@@ -478,7 +439,7 @@
 				if (scgp->errstr)
 					js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
-				return (0);
+				continue;
 			}
 		} else {
 			sg_clearnblock(f);	/* Be very proper about this */
@@ -507,7 +468,7 @@
 				if (scgp->errstr)
 					js_snprintf(scgp->errstr, SCSI_ERRSTR_SIZE,
 							"Cannot open '%s'", devname);
-				return (0);
+				continue;
 			}
 		} else {
 			sg_clearnblock(f);	/* Be very proper about this */
@@ -528,19 +489,6 @@
 			if (b < 0 || b > 25)
 				b = -1;
 		}
-		if (scgp->overbose) {
-			/*
-			 * Before you patch this away, are you sure that you
-			 * know what you are going to to?
-			 *
-			 * Note that this is a warning that helps users from
-			 * cdda2wav, mkisofs and other programs (that
-			 * distinguish SCSI addresses from file names) from
-			 * getting unexpected results.
-			 */
-			js_fprintf((FILE *)scgp->errfile,
-			"Warning: Open by 'devname' is unintentional and not supported.\n");
-		}
 					/* O_NONBLOCK is dangerous */
 		f = open(device, O_RDWR | O_NONBLOCK);
 /*		if (f < 0 && errno == ENOENT)*/
@@ -639,12 +587,8 @@
 }
 
 /*
- * The Linux kernel becomes more and more unmaintainable.
- * Every year, a new incompatible SCSI transport interface is added.
- * Each of them has it's own contradictory constraints.
- * While you cannot have O_NONBLOCK set during operation, at least one
- * of the drivers requires O_NONBLOCK to be set during open().
- * This is used to clear O_NONBLOCK immediately after open() succeeded.
+ * This is used to clear O_NONBLOCK immediately after open() succeeded,
+ * some Linux devices appear to require O_NONBLOCK during operation.
  */
 LOCAL void
 sg_clearnblock(f)

Reply to: