From: Douglas Gilber <dgilbert@interlog.com>
Date: Thu, 5 Dec 2013 10:33:44 +0100
Subject: Update to lsscsi-0.24

Update existing lsscsi to be compliant with 0.24

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/lsscsi.8 b/lsscsi.8
index df4cf4a..324066a 100644
--- a/lsscsi.8
+++ b/lsscsi.8
@@ -10,7 +10,7 @@ lsscsi \- list SCSI devices (or hosts) and their attributes
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-Uses information in sysfs (linux kernel series 2.6 and later) to list scsi
+Uses information in sysfs (Linux kernel series 2.6 and later) to list scsi
 devices (or hosts) currently attached to the system. Options can be used to
 control the amount and form of information provided for each device.
 .PP
@@ -33,7 +33,7 @@ given a different name by udev (for example) to be correctly reported by
 this utility.
 .PP
 In some situations it may be useful to see the device node name that
-linux would produce by default, so the \fI\-\-kname\fR option is provided.
+Linux would produce by default, so the \fI\-\-kname\fR option is provided.
 An example of where this may be useful is kernel error logs which tend to
 report disk error messages using the disk's default kernel name.
 .PP
@@ -60,7 +60,7 @@ List the SCSI hosts currently attached to the system. If this option is
 not given then SCSI devices are listed.
 .TP
 \fB\-k\fR, \fB\-\-kname\fR
-Use linux default algorithm for naming devices (e.g. block major 8,
+Use Linux default algorithm for naming devices (e.g. block major 8,
 minor 0 is "/dev/sda") rather than the "match by major and minor"
 in the "/dev" directory as discussed above.
 .TP
@@ -112,7 +112,7 @@ level driver and can only be accessed via a scsi generic (sg) device
 name.
 .PP
 lsscsi version 0.21 or later is required to correctly display SCSI devices
-in linux kernel 2.6.26 (and possibly later) when the
+in Linux kernel 2.6.26 (and possibly later) when the
 CONFIG_SYSFS_DEPRECATED_V2 kernel option is not defined.
 .SH TRANSPORTS
 This utility lists SCSI devices which are known as logical units (lu) in
@@ -145,9 +145,9 @@ The transports that are currently recognized are: IEEE 1394, ATA, FC,
 iSCSI, SAS, SATA, SPI and USB.
 .PP
 For IEEE 1394 (a.k.a. Firewire and "SBP" when storage is involved), the
-EUI-64 based target port name is output when \fI\-\-transport\fR is given,
+EUI\-64 based target port name is output when \fI\-\-transport\fR is given,
 in the absence of the \fI\-\-hosts\fR option. When the \fI\-\-hosts\fR
-option is given then the EUI-64 initiator port name is output. Output on
+option is given then the EUI\-64 initiator port name is output. Output on
 the summary line specific to the IEEE 1394 transport is prefixed by "sbp:".
 .PP
 to detect ATA and SATA a crude check is performed on the driver
@@ -187,7 +187,7 @@ option is given then only "spi:" is output on the summary line.
 .PP
 When a USB transport is detected, the summary line will contain "usb:"
 followed by a USB device name. The USB device name has the
-form "<b>-<p1>[.<p2>[.<p3>]]:<c>.<i>" where <b> is the USB bus number, <p1>
+form "<b>\-<p1>[.<p2>[.<p3>]]:<c>.<i>" where <b> is the USB bus number, <p1>
 is the port on the host. <p2> is a port on a host connected hub, if present.
 If needed <p3> is a USB hub port closer to the USB storage device. <c>
 refers to the configuration number while <i> is the interface number. There
@@ -200,7 +200,7 @@ Written by Doug Gilbert
 .SH "REPORTING BUGS"
 Report bugs to <dgilbert at interlog dot com>.
 .SH COPYRIGHT
-Copyright \(co 2003\-2009 Douglas Gilbert
+Copyright \(co 2003\-2010 Douglas Gilbert
 .br
 This software is distributed under the GPL version 2. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/lsscsi.c b/lsscsi.c
index 9fa9489..7b5dfea 100644
--- a/lsscsi.c
+++ b/lsscsi.c
@@ -26,7 +26,7 @@
 #include <linux/major.h>
 #include <time.h>
 
-static const char * version_str = "0.23  2009/12/03";
+static const char * version_str = "0.23  2010/12/23 [svn: r83]";
 
 #define NAME_LEN_MAX 260
 #define FT_OTHER 0
@@ -1027,7 +1027,7 @@ transport_init_longer(const char * path_name,
                 break;
         case TRANSPORT_FC:
                 printf("  transport=fc\n");
-                strcat(buff, "/device/fc_host:");
+                strcat(buff, "/device/fc_host/");
                 strcat(buff, cp);
                 if (get_value(buff, "node_name", value, NAME_LEN_MAX))
                         printf("  node_name=%s\n", value);
@@ -1394,7 +1394,7 @@ transport_tport_longer(const char * devname,
                         return;
                 *cp = '\0';
                 cp = basename(wd);
-                strcpy(buff, "fc_remote_ports:");
+                strcpy(buff, "fc_remote_ports/");
                 strcat(buff, cp);
                 if (! if_directory_chdir(wd, buff))
                         return;
@@ -2119,7 +2119,8 @@ one_host_entry(const char * dir_name, const char * devname,
 {
         char buff[NAME_LEN_MAX];
         char value[NAME_LEN_MAX];
-        char * nullname = "<NULL>";
+        char * nullname1 = "<NULL>";
+        char * nullname2 = "(null)";
         unsigned int host_id;
 
         if (opts->classic) {
@@ -2135,13 +2136,13 @@ one_host_entry(const char * dir_name, const char * devname,
         strcat(buff, "/");
         strcat(buff, devname);
         if ((get_value(buff, "proc_name", value, NAME_LEN_MAX)) &&
-            (strncmp(value, nullname, 6)))
+            (strncmp(value, nullname1, 6)) && (strncmp(value, nullname2, 6)))
                 printf("  %-12s  ", value);
         else if (if_directory_chdir(buff, "device/../driver")) {
                 char wd[NAME_LEN_MAX];
 
                 if (NULL == getcwd(wd, NAME_LEN_MAX))
-                        printf("  %-12s  ", nullname);
+                        printf("  %-12s  ", nullname2);
                 else
                         printf("  %-12s  ", basename(wd));
 
-- 
1.7.12.4

