From 934f2d4c5be5d4d1c5c4e42b3d5ede020333c311 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 9 Jan 2010 14:25:19 +0000 Subject: [PATCH] Better error message with unknown SCSI error codes --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/spc.c | 24 ++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 3353e1eb..dafed441 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2010.01.04.135427" +#define Cdrskin_timestamP "2010.01.09.142642" diff --git a/libburn/trunk/libburn/spc.c b/libburn/trunk/libburn/spc.c index 73a40610..d8814007 100644 --- a/libburn/trunk/libburn/spc.c +++ b/libburn/trunk/libburn/spc.c @@ -932,6 +932,24 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense, int *key, int *asc, int *ascq) { char *msg; + static char key_def[16][40] = { + "(no specific error)", + "Recovered error", + "Drive not ready", + "Medium error", + "Drive error", + "Illegal request", + "Drive event", + "Data protected", + "Blank/Nonblank", + "Vendor specific code", + "Copy aborted", + "Command aborted", + "(obsolete error code)", + "Volume overflow", + "Miscompare", + "(reserved error code)", + }; msg= msg_data; *key= *asc= *ascq= -1; @@ -943,7 +961,7 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense, if (senselen<=0 || senselen>13) *ascq = sense[13]; - sprintf(msg, "[%X %2.2X %2.2X] ", *key, *asc, *ascq); + sprintf(msg, "[%X %2.2X %2.2X]", (*key) & 0xf, *asc, *ascq); msg= msg + strlen(msg); burn_print(12, "CONDITION: 0x%x 0x%x 0x%x on %s %s\n", @@ -1212,8 +1230,8 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense, return FAIL; } sprintf(msg_data, - "Failure. See mmc3r10g.pdf: Sense Key %X ASC %2.2X ASCQ %2.2X", - *key, *asc, *ascq); + "See MMC specs: Sense Key %X \"%s\", ASC %2.2X ASCQ %2.2X", + *key & 0xf, key_def[(*key) & 0xf], *asc, *ascq); return FAIL; }