From d4485d5b472462f2ee34bb18f1cef77d2c883b8e Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Mon, 30 Aug 2021 21:15:57 +0000 Subject: improve transport error handling. To fix report of a BAD_TARGET transport error but the utility still continued. introduce SG_LIB_TRANSPORT_ERROR [35] exit status git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@910 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- include/sg_lib.h | 3 +++ include/sg_lib_data.h | 1 + 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/sg_lib.h b/include/sg_lib.h index 857f0d1c..35b44d69 100644 --- a/include/sg_lib.h +++ b/include/sg_lib.h @@ -472,6 +472,7 @@ bool sg_exit2str(int exit_status, bool longer, int b_len, char * b); #define SG_LIB_CAT_MISCOMPARE 14 /* sense key, probably verify * [sk,asc,ascq: 0xe,*,*] */ #define SG_LIB_FILE_ERROR 15 /* device or other file problem */ +/* for 17 and 18, see below */ #define SG_LIB_CAT_NO_SENSE 20 /* sense data with key of "no sense" * [sk,asc,ascq: 0x0,*,*] */ #define SG_LIB_CAT_RECOVERED 21 /* Successful command after recovered err @@ -490,8 +491,10 @@ bool sg_exit2str(int exit_status, bool longer, int b_len, char * b); #define SG_LIB_CAT_TASK_ABORTED 29 /* SCSI status, this command aborted by? */ #define SG_LIB_CONTRADICT 31 /* error involving two or more cl options */ #define SG_LIB_LOGIC_ERROR 32 /* unexpected situation in code */ +/* for 33 see SG_LIB_CAT_TIMEOUT below */ #define SG_LIB_WINDOWS_ERR 34 /* Windows error number don't fit in 7 bits so * map to a single value for exit statuses */ +#define SG_LIB_TRANSPORT_ERROR 35 /* driver or interconnect */ #define SG_LIB_OK_FALSE 36 /* no error, reporting false (cf. no error, * reporting true is SG_LIB_OK_TRUE(0) ) */ #define SG_LIB_CAT_PROTECTION 40 /* subset of aborted command (for PI, DIF) diff --git a/include/sg_lib_data.h b/include/sg_lib_data.h index 2f142a22..01c132ea 100644 --- a/include/sg_lib_data.h +++ b/include/sg_lib_data.h @@ -120,6 +120,7 @@ extern struct sg_lib_value_name_t sg_lib_zoning_in_arr[]; extern struct sg_lib_value_name_t sg_lib_read_attr_arr[]; extern struct sg_lib_value_name_t sg_lib_read_pos_arr[]; extern struct sg_lib_asc_ascq_range_t sg_lib_asc_ascq_range[]; +extern struct sg_lib_simple_value_name_t sg_lib_sstatus_str_arr[]; extern struct sg_lib_asc_ascq_t sg_lib_asc_ascq[]; extern struct sg_lib_value_name_t sg_lib_scsi_feature_sets[]; extern const char * sg_lib_sense_key_desc[]; -- cgit v1.2.3