diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-12-31 19:02:04 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-12-31 19:02:04 +0000 |
commit | a4e181c479918a5697a1826960265706049dd929 (patch) | |
tree | c2b81963f724c052d7e8bb6b5813f975fccbf289 /src | |
parent | a80fb97517110b355fe16a190328699d6bd9ca17 (diff) | |
download | sg3_utils-a4e181c479918a5697a1826960265706049dd929.tar.gz |
sg_logs: further tweak -lll to cope with missing [0,0xff] 'supported ... subpages' page
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@928 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src')
-rw-r--r-- | src/sg_logs.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/sg_logs.c b/src/sg_logs.c index a5b22f85..694ee6e7 100644 --- a/src/sg_logs.c +++ b/src/sg_logs.c @@ -36,7 +36,7 @@ #include "sg_unaligned.h" #include "sg_pr2serr.h" -static const char * version_str = "1.90 20211227"; /* spc6r06 + sbc5r01 */ +static const char * version_str = "1.91 20211231"; /* spc6r06 + sbc5r01 */ #define MX_ALLOC_LEN (0xfffc) #define SHORT_RESP_LEN 128 @@ -6953,7 +6953,8 @@ merge_both_supported(const uint8_t * supp_pgs_p, int su_p_pg_len, int pg_len) int main(int argc, char * argv[]) { - int k, pg_len, res, resp_len, vb; + int k, pg_len, res, vb; + int resp_len = 0; int su_p_pg_len = 0; int in_len = -1; int sg_fd = -1; @@ -7264,9 +7265,19 @@ bad: pr2serr("log_sense: not supported\n"); else if (SG_LIB_CAT_NOT_READY == res) pr2serr("log_sense: device not ready\n"); - else if (SG_LIB_CAT_ILLEGAL_REQ == res) - pr2serr("log_sense: field in cdb illegal\n"); - else if (SG_LIB_CAT_UNIT_ATTENTION == res) + else if (SG_LIB_CAT_ILLEGAL_REQ == res) { + if ((op->do_list > 2) && (SUPP_SPGS_SUBPG == op->subpg_code)) { + rsp_buff[0] = 0x40; + rsp_buff[1] = SUPP_SPGS_SUBPG; + pg_len = 0; + res = 0; + if (op->verbose) + pr2serr("log_sense: field in cdb illegal in [0,0xff], " + "continue with merge\n"); + goto good; + } else + pr2serr("log_sense: field in cdb illegal\n"); + } else if (SG_LIB_CAT_UNIT_ATTENTION == res) pr2serr("log_sense: unit attention\n"); else if (SG_LIB_CAT_ABORTED_COMMAND == res) pr2serr("log_sense: aborted command\n"); |