Human readable error messages with asynchronous SCSI errors

This commit is contained in:
Thomas Schmitt 2009-02-19 19:28:16 +00:00
parent c2f68b0edf
commit 8c1bf841e2
2 changed files with 18 additions and 2 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.02.04.102822" #define Cdrskin_timestamP "2009.02.19.192801"

View File

@ -104,7 +104,9 @@ int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text,
int flag) int flag)
{ {
int i, ret = 1, key = 0, asc = 0, ascq = 0; int i, ret = 1, key = 0, asc = 0, ascq = 0;
char msg[160]; char msg[320];
unsigned char sense[14];
enum response resp;
if (!(flag & 1)) if (!(flag & 1))
usleep(100000); usleep(100000);
@ -138,10 +140,24 @@ int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text,
/* media change notice = try again */ /* media change notice = try again */
goto slumber; goto slumber;
#ifdef NIX
sprintf(msg, sprintf(msg,
"Asynchromous SCSI error on %s: key=%X asc=%2.2Xh ascq=%2.2Xh", "Asynchromous SCSI error on %s: key=%X asc=%2.2Xh ascq=%2.2Xh",
cmd_text, (unsigned) key, (unsigned) asc, cmd_text, (unsigned) key, (unsigned) asc,
(unsigned) ascq); (unsigned) ascq);
#else
/* ts A90213 */
sprintf(msg,
"Asynchromous SCSI error on %s: ", cmd_text);
sense[2] = key;
sense[12] = asc;
sense[13] = ascq;
resp = scsi_error_msg(d, sense, 14, msg + strlen(msg),
&key, &asc, &ascq);
#endif /* ! NIX */
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002014d, 0x0002014d,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,