aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sg_lib.c13
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)
{