aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-10-27 18:07:47 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-10-27 18:07:47 +0000
commit7ce49e15a453f598ce6cc08933c5d961dcf86b46 (patch)
tree4018c626168817c8880f984210b19a12045b45d0
parentdf021e02a8ebe19d0537bb836b988bc7d424f79e (diff)
downloadsg3_utils-7ce49e15a453f598ce6cc08933c5d961dcf86b46.tar.gz
sg_stream_ctl: fix --get indexing; fix some './configure --enable-debug' issues
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@976 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog3
-rw-r--r--include/sg_pr2serr.h2
-rw-r--r--src/sg_inq.c2
-rw-r--r--src/sg_rep_zones.c4
-rw-r--r--src/sg_stream_ctl.c10
-rw-r--r--src/sg_vpd.c2
-rw-r--r--src/sg_vpd_common.c10
7 files changed, 17 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index d50470de..470a235a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.
-Changelog for pre-release sg3_utils-1.48 [20221020] [svn: r975]
+Changelog for pre-release sg3_utils-1.48 [20221027] [svn: r976]
- some utilities: add experimental --json[=JO] option
- sg_z_act_query: new utility for sending either a
Zone activate or Zone query command
@@ -69,6 +69,7 @@ Changelog for pre-release sg3_utils-1.48 [20221020] [svn: r975]
- sg_ses: add exp_sas_addr acronym for getting expander's
SAS address
- sg_turs: change nanosleep() to Sleep() in MinGW
+ - sg_stream_ctl: fix --get indexing
- inhex/logs_last_n.hex: new, tests for the 4 "Last n ..."
log (sub)pages
- sg_lib: add sg_pdt_s_eq() to cope with ZBC disks which may
diff --git a/include/sg_pr2serr.h b/include/sg_pr2serr.h
index 556ff596..bebf9900 100644
--- a/include/sg_pr2serr.h
+++ b/include/sg_pr2serr.h
@@ -273,7 +273,7 @@ void sgj_js_nv_ihexstr_nex(sgj_state * jsp, sgj_opaque_p jop,
const char * nex_s);
/* Add named field whose value is a (large) JSON string made up of num_bytes
- * ASCII hexadecimal bytes (each two hex digits seperated by a space) starting
+ * ASCII hexadecimal bytes (each two hex digits separated by a space) starting
* at byte_arr. The heap is used for intermediate storage so num_bytes can
* be arbitrarily large. */
void sgj_js_nv_hex_bytes(sgj_state * jsp, sgj_opaque_p jop, const char * name,
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 8a9b43e2..bcf5960e 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -2006,7 +2006,7 @@ decode_b0_vpd(uint8_t * buff, int len, struct opts_t * op, sgj_opaque_p jop)
!!(buff[4] & 0x2), false, "Tape Stream Mirror "
"Capable");
sgj_haj_vi_nex(jsp, jop, 2, "WORM", SGJ_SEP_EQUAL_NO_SPACE,
- !!(buff[4] & 0x1), false, "Write Once Read Multple "
+ !!(buff[4] & 0x1), false, "Write Once Read Multiple "
"supported");
break;
diff --git a/src/sg_rep_zones.c b/src/sg_rep_zones.c
index 536f619c..c0d19d31 100644
--- a/src/sg_rep_zones.c
+++ b/src/sg_rep_zones.c
@@ -1314,9 +1314,9 @@ main(int argc, char * argv[])
op->vb = 0;
} else if (! op->verbose_given) {
pr2serr("set '-vv'\n");
- vb = 2;
+ op->vb = 2;
} else
- pr2serr("keep verbose=%d\n", vb);
+ pr2serr("keep verbose=%d\n", op->vb);
#else
if (op->verbose_given && op->version_given)
pr2serr("Not in DEBUG mode, so '-vV' has no special action\n");
diff --git a/src/sg_stream_ctl.c b/src/sg_stream_ctl.c
index 6a07afc0..1f353e96 100644
--- a/src/sg_stream_ctl.c
+++ b/src/sg_stream_ctl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2021 Douglas Gilbert.
+ * Copyright (c) 2018-2022 Douglas Gilbert.
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
@@ -35,7 +35,7 @@
* to the given SCSI device. Based on sbc4r15.pdf .
*/
-static const char * version_str = "1.11 20211114";
+static const char * version_str = "1.12 20221026";
#define STREAM_CONTROL_SA 0x14
#define GET_STREAM_STATUS_SA 0x16
@@ -433,7 +433,7 @@ main(int argc, char * argv[])
}
goto fini;
}
- if ((maxlen - resid) < 4) {
+ if ((maxlen - resid) < 8) {
pr2serr("Response too short (%d bytes) assigned stream id\n",
k);
printf("-1\n");
@@ -441,7 +441,7 @@ main(int argc, char * argv[])
goto fini;
} else
maxlen -= resid;
- param_dl = sg_get_unaligned_be32(arr + 0) + 4;
+ param_dl = sg_get_unaligned_be32(arr + 0) + 8;
if (param_dl > (uint32_t)maxlen) {
pr2serr("Response truncated, need to set --maxlen=%u\n",
param_dl);
@@ -457,7 +457,7 @@ main(int argc, char * argv[])
printf("Number of open streams: %u\n", num_streams);
}
maxlen = ((uint32_t)maxlen < param_dl) ? maxlen : (int)param_dl;
- for (k = 8; k < (maxlen - 4); k += 8) {
+ for (k = 8; k < (maxlen - 8); k += 8) {
stream_id = sg_get_unaligned_be16(arr + k + 2);
if (do_brief)
printf("%u\n", stream_id);
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index 35de6ca4..c8900fb7 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -888,7 +888,7 @@ decode_b0_vpd(uint8_t * buff, int len, struct opts_t * op, sgj_opaque_p jop)
!!(buff[4] & 0x2), false, "Tape Stream Mirror "
"Capable");
sgj_haj_vi_nex(jsp, jop, 2, "WORM", SGJ_SEP_EQUAL_NO_SPACE,
- !!(buff[4] & 0x1), false, "Write Once Read Multple "
+ !!(buff[4] & 0x1), false, "Write Once Read Multiple "
"supported");
break;
case PDT_OSD:
diff --git a/src/sg_vpd_common.c b/src/sg_vpd_common.c
index 31c74ea0..4ec58020 100644
--- a/src/sg_vpd_common.c
+++ b/src/sg_vpd_common.c
@@ -3464,7 +3464,7 @@ decode_rdac_vpd_c9(uint8_t * buff, int len, struct opts_t * op,
sgj_opaque_p jo3p = NULL;
static const char * tpg_s = "Target port group data";
static const char * aas_s = "Asymmetric access state";
- static const char * vs_s = "Vendor specific field";
+ static const char * vsf_s = "Vendor specific field";
char d1[80];
char d2[80];
@@ -3472,13 +3472,13 @@ decode_rdac_vpd_c9(uint8_t * buff, int len, struct opts_t * op,
decode_rdac_vpd_c9_aas_s(buff[10], d1, sizeof(d1));
decode_rdac_vpd_c9_vs_s(buff[11], d2, sizeof(d2));
sgj_pr_hr(jsp, " %s: %s\n", aas_s, d1);
- sgj_pr_hr(jsp, " %s: %s\n", vs_s, d2);
+ sgj_pr_hr(jsp, " %s: %s\n", vsf_s, d2);
if (jsp->pr_as_json) {
jo2p = sgj_snake_named_subobject_r(jsp, jop, tpg_s);
jo3p = sgj_snake_named_subobject_r(jsp, jo2p, "this_controller");
sgj_convert_to_snake_name(aas_s, b, blen);
sgj_js_nv_ihexstr(jsp, jo3p, b, buff[10], NULL, d1);
- sgj_convert_to_snake_name(vs_s, b, blen);
+ sgj_convert_to_snake_name(vsf_s, b, blen);
sgj_js_nv_ihexstr(jsp, jo3p, b, buff[11], NULL, d2);
}
sgj_pr_hr(jsp, " Target Port Group Data (Alternate controller):\n");
@@ -3487,14 +3487,14 @@ decode_rdac_vpd_c9(uint8_t * buff, int len, struct opts_t * op,
decode_rdac_vpd_c9_aas_s(buff[12], d1, sizeof(d1));
decode_rdac_vpd_c9_vs_s(buff[13], d2, sizeof(d2));
sgj_pr_hr(jsp, " %s: %s\n", aas_s, d1);
- sgj_pr_hr(jsp, " %s: %s\n", vs_s, d2);
+ sgj_pr_hr(jsp, " %s: %s\n", vsf_s, d2);
if (jsp->pr_as_json) {
jo2p = sgj_snake_named_subobject_r(jsp, jop, tpg_s);
jo3p = sgj_snake_named_subobject_r(jsp, jo2p,
"alternate_controller");
sgj_convert_to_snake_name(aas_s, b, blen);
sgj_js_nv_ihexstr(jsp, jo3p, b, buff[12], NULL, d1);
- sgj_convert_to_snake_name(vs_s, b, blen);
+ sgj_convert_to_snake_name(vsf_s, b, blen);
sgj_js_nv_ihexstr(jsp, jo3p, b, buff[13], NULL, d2);
}
}