aboutsummaryrefslogtreecommitdiff
path: root/src/sg_read_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sg_read_attr.c')
-rw-r--r--src/sg_read_attr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sg_read_attr.c b/src/sg_read_attr.c
index 3f5d6528..87124d3c 100644
--- a/src/sg_read_attr.c
+++ b/src/sg_read_attr.c
@@ -39,7 +39,7 @@
* and decodes the response. Based on spc5r08.pdf
*/
-static const char * version_str = "1.14 20210610";
+static const char * version_str = "1.15 20210830";
#define MAX_RATTR_BUFF_LEN (1024 * 1024)
#define DEF_RATTR_BUFF_LEN (1024 * 8)
@@ -283,9 +283,12 @@ sg_ll_read_attr(int sg_fd, void * resp, int * residp, bool noisy,
res = do_scsi_pt(ptvp, sg_fd, DEF_PT_TIMEOUT, op->verbose);
ret = sg_cmds_process_resp(ptvp, "read attribute", res, noisy,
op->verbose, &sense_cat);
- if (-1 == ret)
- ret = sg_convert_errno(get_scsi_pt_os_err(ptvp));
- else if (-2 == ret) {
+ if (-1 == ret) {
+ if (get_scsi_pt_transport_err(ptvp))
+ ret = SG_LIB_TRANSPORT_ERROR;
+ else
+ ret = sg_convert_errno(get_scsi_pt_os_err(ptvp));
+ } else if (-2 == ret) {
switch (sense_cat) {
case SG_LIB_CAT_RECOVERED:
case SG_LIB_CAT_NO_SENSE: