diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-05-15 21:17:40 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-05-15 21:17:40 +0000 |
commit | 46fc8659ec9bfc87e58008a5341393a86ca40c52 (patch) | |
tree | b7b8af0a5107f2c53a9215c880d8e8e0863b2ac9 /lib | |
parent | a5226c6f336ee819b21e5b27e971fa560502c844 (diff) | |
download | sg3_utils-46fc8659ec9bfc87e58008a5341393a86ca40c52.tar.gz |
sg_lib: add sg_scsi_status_is_bad(); testing/ work
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@901 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sg_lib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sg_lib.c b/lib/sg_lib.c index 780a3a4d..3e66e13a 100644 --- a/lib/sg_lib.c +++ b/lib/sg_lib.c @@ -274,6 +274,19 @@ sg_scsi_status_is_good(int sstatus) } } +bool +sg_scsi_status_is_bad(int sstatus) +{ + sstatus &= 0xfe; + switch (sstatus) { + case SAM_STAT_GOOD: + case SAM_STAT_CONDITION_MET: + return false; + default: + return true; + } +} + void sg_get_scsi_status_str(int scsi_status, int buff_len, char * buff) { |