From 4334043f1ed11be8bd29c42d721805b357591d39 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 11 Feb 2008 19:49:03 +0000 Subject: [PATCH] New severity MISHAP --- libisoburn/trunk/libisoburn/burn_wrap.c | 17 +++++++++ libisoburn/trunk/xorriso/xorriso.1 | 5 +-- libisoburn/trunk/xorriso/xorriso.c | 1 + libisoburn/trunk/xorriso/xorriso_private.h | 1 + libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 36 +++++++++++++------- 6 files changed, 46 insertions(+), 16 deletions(-) diff --git a/libisoburn/trunk/libisoburn/burn_wrap.c b/libisoburn/trunk/libisoburn/burn_wrap.c index 26c1ee14..04a24743 100644 --- a/libisoburn/trunk/libisoburn/burn_wrap.c +++ b/libisoburn/trunk/libisoburn/burn_wrap.c @@ -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) { diff --git a/libisoburn/trunk/xorriso/xorriso.1 b/libisoburn/trunk/xorriso/xorriso.1 index ade75d41..09993fb3 100644 --- a/libisoburn/trunk/xorriso/xorriso.1 +++ b/libisoburn/trunk/xorriso/xorriso.1 @@ -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 diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index 9a2684c4..a349bb87 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -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; diff --git a/libisoburn/trunk/xorriso/xorriso_private.h b/libisoburn/trunk/xorriso/xorriso_private.h index 9ca02b84..1ea10de1 100644 --- a/libisoburn/trunk/xorriso/xorriso_private.h +++ b/libisoburn/trunk/xorriso/xorriso_private.h @@ -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 */ diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 9058ecac..10a8e214 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.02.11.174517" +#define Xorriso_timestamP "2008.02.11.194807" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index cfb00b73..fe83915d 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -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++;