diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-08-30 21:15:57 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-08-30 21:15:57 +0000 |
commit | d4485d5b472462f2ee34bb18f1cef77d2c883b8e (patch) | |
tree | 6a3709bf6a6ef5ed2895c24c852281f3b3ee0580 /lib/sg_lib.c | |
parent | 5fbd329cbcb0078fc787467703a2581935405b7e (diff) | |
download | sg3_utils-d4485d5b472462f2ee34bb18f1cef77d2c883b8e.tar.gz |
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
Diffstat (limited to 'lib/sg_lib.c')
-rw-r--r-- | lib/sg_lib.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/sg_lib.c b/lib/sg_lib.c index c5eeeddc..02102a1c 100644 --- a/lib/sg_lib.c +++ b/lib/sg_lib.c @@ -245,22 +245,6 @@ sg_print_command(const uint8_t * cdbp) sg_print_command_len(cdbp, 0); } -/* SCSI Status values */ -static const struct sg_lib_simple_value_name_t sstatus_str_arr[] = { - {0x0, "Good"}, - {0x2, "Check Condition"}, - {0x4, "Condition Met"}, - {0x8, "Busy"}, - {0x10, "Intermediate (obsolete)"}, - {0x14, "Intermediate-Condition Met (obsolete)"}, - {0x18, "Reservation Conflict"}, - {0x22, "Command terminated (obsolete)"}, - {0x28, "Task Set Full"}, - {0x30, "ACA Active"}, - {0x40, "Task Aborted"}, - {0xffff, NULL}, -}; - bool sg_scsi_status_is_good(int sstatus) { @@ -299,7 +283,7 @@ sg_get_scsi_status_str(int scsi_status, int buff_len, char * buff) return; } scsi_status &= 0x7e; /* sanitize as much as possible */ - for (sstatus_p = sstatus_str_arr; sstatus_p->name; ++sstatus_p) { + for (sstatus_p = sg_lib_sstatus_str_arr; sstatus_p->name; ++sstatus_p) { if (scsi_status == sstatus_p->value) break; } |