Human readable error messages with asynchronous SCSI errors

This commit is contained in:
Thomas Schmitt 2009-02-19 19:28:16 +00:00
parent 5f55a436e8
commit 350ac05bfd
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 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))
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 */
goto slumber;
#ifdef NIX
sprintf(msg,
"Asynchromous SCSI error on %s: key=%X asc=%2.2Xh ascq=%2.2Xh",
cmd_text, (unsigned) key, (unsigned) asc,
(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,
0x0002014d,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,