Issueing error messages if cache syncing or closing fails

This commit is contained in:
Thomas Schmitt 2010-10-29 16:41:16 +00:00
parent aee0323fe4
commit 1d86a0be2f
3 changed files with 25 additions and 1 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2010.10.20.133509"
#define Cdrskin_timestamP "2010.10.29.164059"

View File

@ -563,6 +563,8 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x0002017b (WARNING,HIGH) = Sequential BD-R media likely to soon fail writing
0x0002017c (FAILURE,HIGH) = No valid write type selected
0x0002017d (FATAL,HIGH) = Invalid file descriptor with stdio pseudo-drive
0x0002017e (FAILURE,HIGH) = Failed to close track, session, or disc
0x0002017f (FAILURE,HIGH) = Failed to synchronize drive cache
libdax_audioxtr:
0x00020200 (SORRY,HIGH) = Cannot open audio source file

View File

@ -521,6 +521,8 @@ void mmc_close_session(struct burn_write_opts *o)
void mmc_close(struct burn_drive *d, int session, int track)
{
struct command c;
char msg[256];
int key, asc, ascq;
if (mmc_function_spy(d, "mmc_close") <= 0)
return;
@ -544,6 +546,16 @@ void mmc_close(struct burn_drive *d, int session, int track)
/* ts A70918 : Immed : wait for drive to complete command */
if (c.error) {
sprintf(msg, "Failed to close %s (%d)",
session > 1 ? "disc" : session > 0 ? "session" : "track",
((session & 3) << 1) | !!track);
sprintf(msg + strlen(msg), ". SCSI error : ");
scsi_error_msg(d, c.sense, 14, msg + strlen(msg),
&key, &asc, &ascq);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002017e,
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
d->cancel = 1;
return;
}
@ -2898,6 +2910,8 @@ int mmc_read_format_capacities(struct burn_drive *d, int top_wanted)
void mmc_sync_cache(struct burn_drive *d)
{
struct command c;
char msg[256];
int key, asc, ascq;
if (mmc_function_spy(d, "mmc_sync_cache") <= 0)
return;
@ -2933,6 +2947,14 @@ void mmc_sync_cache(struct burn_drive *d)
/* ts A70918 */
if (c.error) {
sprintf(msg, "Failed to synchronize drive cache");
sprintf(msg + strlen(msg), ". SCSI error : ");
scsi_error_msg(d, c.sense, 14, msg + strlen(msg),
&key, &asc, &ascq);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002017f,
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
d->cancel = 1;
return;
}