Rectified SORRY,FAILURE,FATAL classification

This commit is contained in:
2008-02-06 15:37:54 +00:00
parent 9b525e9fff
commit 3abb7a6a9e
5 changed files with 113 additions and 110 deletions

View File

@ -226,7 +226,7 @@ int Xorriso_get_drive_handles(struct XorrisO *xorriso,
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, "No %s drive aquired %s",
(flag&2 ? "output" : "input"), attempt);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
*drive= (*dinfo)[0].drive;
@ -431,7 +431,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
if(xorriso->dev_fd_1<0) {
sprintf(xorriso->info_text,
"\"stdio:/dev/fd/1\" was not a start argument. stdout possibly already tainted.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
} else {
sprintf(adr_data, "stdio:/dev/fd/%d", xorriso->dev_fd_1);
@ -462,7 +462,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
Xorriso_process_msg_queues(xorriso,0);
if(ret<=0) {
sprintf(xorriso->info_text,"Cannot aquire drive '%s'", adr);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
}
@ -548,7 +548,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
Xorriso_process_msg_queues(xorriso,0);
Xorriso_set_image_severities(xorriso, 0);
sprintf(xorriso->info_text,"Cannot read ISO image volset");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 3; goto ex;
}
xorriso->in_volset_handle= (void *) volset;
@ -667,7 +667,7 @@ int Xorriso_make_write_options(
if(*burn_options==NULL) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,"Cannot allocate option set");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
burn_write_opts_set_simulate(*burn_options, !!xorriso->do_dummy);
@ -755,7 +755,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
else
sprintf(xorriso->info_text,
"-indev differs from -outdev and -outdev media holds valid ISO image");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive,
@ -767,7 +767,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
if (ret <= 0) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,"Failed to prepare session write run");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
@ -814,7 +814,7 @@ no_track:;
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,"Image size %ds exceeds free space on media %ds",
img_sectors + padding, media_space);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
isoburn_cancel_prepared_write(source_drive, drive, 0);
{ret= 0; goto ex;}
}
@ -829,7 +829,7 @@ no_track:;
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"libburn indicates failure with writing.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
@ -939,7 +939,7 @@ int Xorriso_get_volume(struct XorrisO *xorriso, IsoImage **volume,
sprintf(xorriso->info_text+strlen(xorriso->info_text),
" Possible program error with drive '%s'.", xorriso->indev);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
*volume= (IsoImage *) xorriso->in_volset_handle;
@ -964,7 +964,7 @@ int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume,
if(!(flag&1)) {
sprintf(xorriso->info_text, "Cannot find path %s in loaded ISO image",
Text_shellsafe(path_pt, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
}
return(0);
}
@ -1042,7 +1042,7 @@ bonked_root:;
sprintf(xorriso->info_text,
"Relative addressing in path exceeds root directory: %s",
Text_shellsafe(img_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(-1);
}
dir= iso_node_get_parent(node);
@ -1060,7 +1060,7 @@ much_too_long:;
sprintf(xorriso->info_text, "Effective path gets much too long (%d)",
(int) (strlen(eff_path)+strlen(apt)+1));
if(!(flag&1))
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(-1);
}
if(!(flag&2)) {
@ -1181,7 +1181,7 @@ int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir,
cannot_open_dir:;
sprintf(xorriso->info_text,"Cannot open as source directory: %s",
Text_shellsafe(disk_dir_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
@ -1220,7 +1220,7 @@ cannot_lstat:;
sprintf(xorriso->info_text,
"Cannot determine attributes of source file %s",
Text_shellsafe(srcpt, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
ret= 0; goto was_problem;
}
source_is_dir= 0;
@ -1258,7 +1258,7 @@ cannot_lstat:;
sprintf(xorriso->info_text,"Source file %s %s non-supported file type",
Text_shellsafe(disk_path, sfe, 0),
source_is_link ? "leads to" : "is of");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto was_problem;
#endif /* NIX */
@ -1289,7 +1289,7 @@ cannot_lstat:;
sprintf(xorriso->info_text,
"While grafting %s : file object exists and may not be overwritten",
Text_shellsafe(img_path,sfe,0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto was_problem;
}
}
@ -1310,14 +1310,14 @@ cannot_lstat:;
goto was_problem;
} else {
Xorriso_report_iso_error(xorriso, stbuf_src, ret,
"Cannot create symbolic link", 0, "SORRY", 1);
"Cannot create symbolic link", 0, "FAILURE", 1);
{ret= 0; goto was_problem;}
}
} else {
ret= iso_tree_add_node(volume, dir, srcpt, &node);
if(ret<0) {
Xorriso_report_iso_error(xorriso, stbuf_src, ret,
"Cannot add node to tree", 0, "SORRY", 1);
"Cannot add node to tree", 0, "FAILURE", 1);
goto was_problem;
}
}
@ -1326,7 +1326,7 @@ cannot_lstat:;
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, "Grafting failed: %s = %s",
Text_shellsafe(img_path,sfe,0), Text_shellsafe(disk_path,sfe2,0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret=0; goto was_problem;
}
@ -1411,7 +1411,7 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
if(cpt!=NULL) {
sprintf(xorriso->info_text,
"Unsupported relative addressing in iso_rr_path '%s'", img_path);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
return(0);
}
@ -1432,7 +1432,7 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"Cannot determine attributes of source file '%s'",disk_path);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
return(0);
}
if(S_ISDIR(stbuf.st_mode)) {
@ -1443,7 +1443,7 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"Source file '%s' is of non-supported file type", disk_path);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
#endif /* NIX */
@ -1456,7 +1456,7 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
sprintf(xorriso->info_text,
"Source '%s' is not a directory. Target '%s' would be.",
disk_path, img_path);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
}
@ -1510,7 +1510,7 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
sprintf(xorriso->info_text,
"While grafting '%s' : '%s' exists and may not be overwritten",
img_path, path);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
dir= (IsoDir *) node;
@ -1522,10 +1522,10 @@ handle_path_node:;
if(ret<0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, img_path, ret,
"Cannot create directory", 0, "SORRY", 1);
"Cannot create directory", 0, "FAILURE", 1);
sprintf(xorriso->info_text,
"While grafting '%s' : could not insert '%s'", img_path, path);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
dir= hdir;
@ -1559,10 +1559,10 @@ attach_source:;
if(ret<0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, img_path, ret, "Cannot create node",
0, "SORRY", 1);
0, "FAILURE", 1);
sprintf(xorriso->info_text, "Grafting failed: %s = %s",
Text_shellsafe(img_path,sfe,0), Text_shellsafe(disk_path,sfe2,0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
xorriso->volset_change_pending= 1;
@ -1941,16 +1941,16 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
;
} else if(disc_state == BURN_DISC_EMPTY) {
sprintf(xorriso->info_text,"No media detected in drive");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return 0;
} else {
sprintf(xorriso->info_text, "Unsuitable drive and media state");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return 0;
}
if(!isoburn_disc_erasable(drive)) {
sprintf(xorriso->info_text, "Media is not of erasable type");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return 0;
}
if(xorriso->do_dummy) {
@ -2006,7 +2006,7 @@ int Xorriso_format_media(struct XorrisO *xorriso, int flag)
} else {
sprintf(xorriso->info_text,
"Can only -format DVD+RW and sequential DVD-RW");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
sprintf(xorriso->info_text,"Media current: %s (%4.4xh)",
current_profile_name, current_profile);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
@ -2092,7 +2092,7 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter,
root_dir= iso_image_get_root(volume);
if(((void *) root_dir) == ((void *) victim_node)) {
sprintf(xorriso->info_text, "May not delete root directory");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
@ -2102,7 +2102,7 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter,
if(flag&2) { /* rmdir */
sprintf(xorriso->info_text, "%s in loaded ISO image is not a directory",
Text_shellsafe(path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
} else {
@ -2153,7 +2153,7 @@ dir_not_removed:;
if(!(flag&2)) { /* not rmdir */
sprintf(xorriso->info_text, "%s in loaded ISO image is a directory",
Text_shellsafe(path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
@ -2166,7 +2166,7 @@ dir_not_removed:;
sprintf(xorriso->info_text,
"Directory not empty on attempt to delete: %s",
Text_shellsafe(path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
}
@ -2181,7 +2181,7 @@ dir_not_removed:;
sprintf(xorriso->info_text,
"Cannot find parent node of %s in loaded ISO image",
Text_shellsafe(path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
@ -2757,7 +2757,7 @@ int Xorriso_ls(struct XorrisO *xorriso, int flag)
wdi_is_not_a_dir:;
sprintf(xorriso->info_text,
"Working directory path does not lead to a directory in ISO image");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
if(flag&2)
@ -2877,7 +2877,7 @@ int Xorriso_rename(struct XorrisO *xorriso, char *origin, char *dest, int flag)
ol= strlen(eff_origin);
if(ol==0) {
sprintf(xorriso->info_text, "May not rename root directory");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
} else if(strcmp(eff_origin, eff_dest)==0) {
sprintf(xorriso->info_text, "Ignored attempt to rename %s to itself",
@ -2889,7 +2889,7 @@ int Xorriso_rename(struct XorrisO *xorriso, char *origin, char *dest, int flag)
sprintf(xorriso->info_text,
"May not rename %s to its own sub address %s",
Text_shellsafe(eff_origin,sfe,0), Text_shellsafe(eff_dest,sfe2,0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
@ -2897,12 +2897,12 @@ int Xorriso_rename(struct XorrisO *xorriso, char *origin, char *dest, int flag)
if(dest_ret==2 && xorriso->do_overwrite!=1) {
sprintf(xorriso->info_text, "Renaming may not overwrite directory: %s",
Text_shellsafe(eff_dest, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
} else if (dest_ret==1 && !xorriso->do_overwrite) {
sprintf(xorriso->info_text, "Renaming may not overwite: %s",
Text_shellsafe(eff_dest, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
} else if(dest_ret>0) {
ret= Xorriso_rmi(xorriso, NULL, eff_dest, 1|8);
@ -3007,7 +3007,7 @@ int Xorriso_mkdir(struct XorrisO *xorriso, char *path, int flag)
sprintf(xorriso->info_text,"-mkdir: Address already existing %s",
Text_shellsafe(eff_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0,
(ret==2 ? "WARNING" : "SORRY"), 0);
(ret==2 ? "WARNING" : "FAILURE"), 0);
return(-1+(ret==2));
}
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2);
@ -3109,7 +3109,7 @@ ex:;
}
/* @param flag bit0= a match count !=1 is a SORRY event
/* @param flag bit0= a match count !=1 is a FAILURE event
bit1= with bit0 tolerate 0 matches if pattern is a constant
*/
int Xorriso_expand_pattern(struct XorrisO *xorriso,
@ -3162,13 +3162,13 @@ int Xorriso_expand_pattern(struct XorrisO *xorriso,
sprintf(xorriso->info_text,
"While expanding pattern %s : Working directory does not exist in ISO image",
Text_shellsafe(patterns[i], sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
if(!LIBISO_ISDIR((IsoNode *) dir)) {
sprintf(xorriso->info_text,
"Working directory path does not lead to a directory in ISO image");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
}
@ -3186,7 +3186,7 @@ int Xorriso_expand_pattern(struct XorrisO *xorriso,
}
ret= Xorriso_check_matchcount(xorriso, count, nonconst_mismatches,
num_patterns, patterns, flag&1);
num_patterns, patterns, (flag&1)|2);
if(ret<=0)
goto ex;
count+= extra_filec;