aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2021-08-31 21:15:38 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2021-08-31 21:15:38 +0000
commit7144ac65deef1369c1c754c2e561c813878ab046 (patch)
tree22ce45fa81c96651d7e3e32a426e516d882493b6 /lib
parentd4485d5b472462f2ee34bb18f1cef77d2c883b8e (diff)
downloadsg3_utils-7144ac65deef1369c1c754c2e561c813878ab046.tar.gz
sg_get_elem_status: fix issue with '--maxlen=' option, add 2 depopulation revocation health attributes [sbc5r01]
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@911 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib')
-rw-r--r--lib/sg_io_linux.c7
-rw-r--r--lib/sg_pt_linux.c19
2 files changed, 9 insertions, 17 deletions
diff --git a/lib/sg_io_linux.c b/lib/sg_io_linux.c
index 9bd4b7eb..968f5e7a 100644
--- a/lib/sg_io_linux.c
+++ b/lib/sg_io_linux.c
@@ -24,7 +24,7 @@
#include "sg_pr2serr.h"
-/* Version 1.12 20210830 */
+/* Version 1.13 20210831 */
void
@@ -87,11 +87,6 @@ sg_print_driver_status(int driver_status)
driv = driver_status & SG_LIB_DRIVER_MASK;
if (driv < (int)SG_ARRAY_SIZE(linux_driver_bytes))
driv_cp = linux_driver_bytes[driv];
-#if 0
- sugg = (driver_status & SG_LIB_SUGGEST_MASK) >> 4;
- if (sugg < (int)SG_ARRAY_SIZE(linux_driver_suggests))
- sugg_cp = linux_driver_suggests[sugg];
-#endif
pr2ws("Driver_status=0x%02x", driver_status);
pr2ws(" [%s] ", driv_cp);
}
diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c
index c6fb9755..c65c5f94 100644
--- a/lib/sg_pt_linux.c
+++ b/lib/sg_pt_linux.c
@@ -71,7 +71,7 @@ static const char * linux_host_bytes[] = {
"DID_NEXUS_FAILURE (reservation conflict)",
"DID_ALLOC_FAILURE",
"DID_MEDIUM_ERROR",
- "DID_TRANSPORT_MARGINAL", /*0x14 */
+ "DID_TRANSPORT_MARGINAL", /*0x14 */
};
/* These where made obsolete around lk 5.12.0 . Only DRIVER_SENSE [0x8] is
@@ -956,16 +956,13 @@ get_scsi_pt_transport_err_str(const struct sg_pt_base * vp, int max_b_len,
return b;
}
cp += n;
- driv = ds & SG_LIB_DRIVER_MASK;
- if (driv < (int)SG_ARRAY_SIZE(linux_driver_bytes))
- driv_cp = linux_driver_bytes[driv];
-#if 0
- sugg = (ds & SG_LIB_SUGGEST_MASK) >> 4;
- if (sugg < SG_ARRAY_SIZE(linux_driver_suggests)
- sugg_cp = linux_driver_suggests[sugg];
-#endif
- n = snprintf(cp, m, "Driver_status=0x%02x [%s]\n", ds, driv_cp);
- m -= n;
+ if (ds) {
+ driv = ds & SG_LIB_DRIVER_MASK;
+ if (driv < (int)SG_ARRAY_SIZE(linux_driver_bytes))
+ driv_cp = linux_driver_bytes[driv];
+ n = snprintf(cp, m, "Driver_status=0x%02x [%s]\n", ds, driv_cp);
+ m -= n;
+ }
if (m < 1)
b[max_b_len - 1] = '\0';
return b;