New severity MISHAP

This commit is contained in:
Thomas Schmitt 2008-02-11 19:49:03 +00:00
parent b93954c1ab
commit 1f0ea7f226
6 changed files with 46 additions and 16 deletions

View File

@ -698,6 +698,7 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
#define LIBDAX_MSGS_SEV_HINT 0x40000000
#define LIBDAX_MSGS_SEV_WARNING 0x50000000
#define LIBDAX_MSGS_SEV_SORRY 0x60000000
#define LIBDAX_MSGS_SEV_MISHAP 0x64000000
#define LIBDAX_MSGS_SEV_FAILURE 0x68000000
#define LIBDAX_MSGS_SEV_FATAL 0x70000000
#define LIBDAX_MSGS_SEV_ABORT 0x71000000
@ -719,6 +720,8 @@ int isoburn__sev_to_text(int severity, char **severity_name,
*severity_name= "FATAL";
else if(severity>=LIBDAX_MSGS_SEV_FAILURE)
*severity_name= "FAILURE";
else if(severity>=LIBDAX_MSGS_SEV_MISHAP)
*severity_name= "MISHAP";
else if(severity>=LIBDAX_MSGS_SEV_SORRY)
*severity_name= "SORRY";
else if(severity>=LIBDAX_MSGS_SEV_WARNING)
@ -741,6 +744,20 @@ int isoburn__sev_to_text(int severity, char **severity_name,
}
int isoburn__text_to_sev(char *severity_name, int *severity_number, int flag)
{
int ret= 1;
if(severity_name[0]==0)
*severity_number= 0;
else if(strcmp(severity_name, "MISHAP")==0)
*severity_number= LIBDAX_MSGS_SEV_MISHAP;
else
ret= burn_text_to_sev(severity_name, severity_number, 0);
return(ret);
}
int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
char min_severity[], int flag)
{

View File

@ -995,8 +995,9 @@ or an important resource failed unexpectedly.
.br
"FAILURE" An important part of the job could not be performed.
.br
"SORRY" A less important part could not be performed or
source file access problems have been ignored at image generation time.
"MISHAP" A FAILURE which can be tolerated during ISO image generation.
.br
"SORRY" A less important part of the job could not be performed.
.br
"WARNING" A situation is suspicious of being not intended by the user.
.br

View File

@ -2744,6 +2744,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->re_count= 0;
m->re_fill= 0;
m->reg_expr[0]= 0;
m->run_state= 0;
m->is_dialog= 0;
m->bar_is_fresh= 0;
m->pending_option[0]= 0;

View File

@ -176,6 +176,7 @@ struct XorrisO { /* the global context of xorriso */
char reg_expr[2*SfileadrL];
/* run state */
int run_state; /* 0=preparing , 1=writing image */
int is_dialog;
int bar_is_fresh;
char pending_option[SfileadrL]; /* eventual option entered at page prompt */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.02.11.174517"
#define Xorriso_timestamP "2008.02.11.194807"

View File

@ -250,6 +250,7 @@ int Xorriso_get_drive_handles(struct XorrisO *xorriso,
#define LIBDAX_MSGS_SEV_HINT 0x40000000
#define LIBDAX_MSGS_SEV_WARNING 0x50000000
#define LIBDAX_MSGS_SEV_SORRY 0x60000000
#define LIBDAX_MSGS_SEV_MISHAP 0x64000000
#define LIBDAX_MSGS_SEV_FAILURE 0x68000000
#define LIBDAX_MSGS_SEV_FATAL 0x70000000
#define LIBDAX_MSGS_SEV_ABORT 0x71000000
@ -271,6 +272,8 @@ int Xorriso__sev_to_text(int severity, char **severity_name,
*severity_name= "FATAL";
else if(severity>=LIBDAX_MSGS_SEV_FAILURE)
*severity_name= "FAILURE";
else if(severity>=LIBDAX_MSGS_SEV_MISHAP)
*severity_name= "MISHAP";
else if(severity>=LIBDAX_MSGS_SEV_SORRY)
*severity_name= "SORRY";
else if(severity>=LIBDAX_MSGS_SEV_WARNING)
@ -293,6 +296,20 @@ int Xorriso__sev_to_text(int severity, char **severity_name,
}
int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
{
int ret= 1;
if(severity_name[0]==0)
*severity_number= 0;
else if(strcmp(severity_name, "MISHAP")==0)
*severity_number= LIBDAX_MSGS_SEV_MISHAP;
else
ret= burn_text_to_sev(severity_name, severity_number, 0);
return(ret);
}
/* @param flag bit0=report libisofs error text */
int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
int iso_error_code, char msg_text[], int os_errno,
@ -312,7 +329,7 @@ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
msg_text_pt= msg_text;
iso_sev= iso_error_get_severity(iso_error_code);
sev_text_pt= min_severity;
burn_text_to_sev(min_severity, &min_sev, 0);
Xorriso__text_to_sev(min_severity, &min_sev, 0);
if(min_sev < iso_sev)
/* >>> with libburn-0.4.4 do: burn_sev_to_text(iso_sev, &sev_text_pt, 0); */
Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0);
@ -874,6 +891,7 @@ no_track:;
{ret= 0; goto ex;}
}
xorriso->run_state= 1; /* Indicate that burning has started */
isoburn_disc_write(burn_options, disc);
burn_write_opts_free(burn_options);
@ -921,6 +939,7 @@ no_track:;
Xorriso_info(xorriso, 0);
ret= 1;
ex:;
xorriso->run_state= 0; /* Indicate that burning has ended */
if(ret<=0) {
/* >>> ??? revive discarded boot image */;
@ -1654,18 +1673,6 @@ attach_source:;
}
int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
{
int ret= 1;
if(severity_name[0]==0)
*severity_number= 0;
else
ret= burn_text_to_sev(severity_name, severity_number, 0);
return(ret);
}
int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
{
int ret, error_code= 0, os_errno= 0, count= 0, pass, imgid, tunneled;
@ -1690,6 +1697,9 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
}
if(ret<=0)
break;
if(pass+tunneled==0 && xorriso->run_state==1 &&
strcmp(severity, "SORRY")==0)
strcpy(severity, "MISHAP"); /* image generation severity */
Xorriso_msgs_submit(xorriso, error_code, xorriso->info_text, os_errno,
severity, ((pass+tunneled)+1)<<2);
count++;