New -error_behavior behavior occasion "file_extraction"
This commit is contained in:
@ -3377,6 +3377,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
|
||||
m->errfile_log[0]= 0;
|
||||
m->errfile_fp= NULL;
|
||||
m->img_read_error_mode= 2; /* abort faulty image reading with FATAL */
|
||||
m->extract_error_mode= 1; /* keep extracted files after read error */
|
||||
strcpy(m->return_with_text, "SORRY");
|
||||
Xorriso__text_to_sev(m->return_with_text, &m->return_with_severity, 0);
|
||||
m->return_with_value= 32;
|
||||
@ -4663,6 +4664,13 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
|
||||
else if(xorriso->img_read_error_mode==2)
|
||||
treatment= "fatal";
|
||||
sprintf(line,"-error_behavior image_loading %s\n", treatment);
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
is_default= (xorriso->extract_error_mode == 1);
|
||||
treatment= "keep";
|
||||
if(xorriso->extract_error_mode == 2)
|
||||
treatment= "delete";
|
||||
sprintf(line,"-error_behavior file_extraction %s\n", treatment);
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
|
||||
@ -8899,7 +8907,8 @@ int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
||||
if(((off_t) (*map)->sectors) * ((off_t) (*map)->sector_size) >
|
||||
((off_t) list_sectors) * ((off_t) sector_size))
|
||||
list_sectors= (((off_t) (*map)->sectors) *
|
||||
((off_t) (*map)->sector_size)) / sector_size + 1;
|
||||
((off_t) (*map)->sector_size)) / ((off_t) sector_size)
|
||||
+ 1;
|
||||
}
|
||||
ret= Sectorbitmap_new(&m, list_sectors, sector_size, 0);
|
||||
if(ret <= 0)
|
||||
@ -10619,12 +10628,20 @@ int Xorriso_option_error_behavior(struct XorrisO *xorriso,
|
||||
else if(strcmp(behavior, "fatal")==0 || strcmp(behavior, "FATAL")==0)
|
||||
xorriso->img_read_error_mode= 2;
|
||||
else {
|
||||
unknown_behavior:;
|
||||
sprintf(xorriso->info_text,
|
||||
"-error_behavior: with 'image_loading': unknown behavior '%s'",
|
||||
behavior);
|
||||
"-error_behavior: with '%s': unknown behavior '%s'",
|
||||
occasion, behavior);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
} else if(strcmp(occasion, "file_extraction")==0) {
|
||||
if(strcmp(behavior, "keep")==0)
|
||||
xorriso->extract_error_mode= 1;
|
||||
else if(strcmp(behavior, "delete")==0)
|
||||
xorriso->extract_error_mode= 2;
|
||||
else
|
||||
goto unknown_behavior;
|
||||
} else {
|
||||
sprintf(xorriso->info_text, "-error_behavior: unknown occasion '%s'",
|
||||
occasion);
|
||||
@ -13989,7 +14006,7 @@ next_command:;
|
||||
if(xorriso->add_plainly>1)
|
||||
goto add_plain_argument;
|
||||
unknown_option:;
|
||||
sprintf(xorriso->info_text, "=== Not a known option:\n === '%s'\n",
|
||||
sprintf(xorriso->info_text, "Not a known option: '%s'\n",
|
||||
original_cmd);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
{ret= 0; goto eval_any_problems;}
|
||||
|
Reference in New Issue
Block a user