"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/opts_a_c.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

opts_a_c.c  (xorriso-1.5.2):opts_a_c.c  (xorriso-1.5.4)
skipping to change at line 1739 skipping to change at line 1739
if(ret <= 0) if(ret <= 0)
return(ret); return(ret);
return((xorriso->find_check_md5_result & 3) == 0); return((xorriso->find_check_md5_result & 3) == 0);
} }
/* Option -check_media */ /* Option -check_media */
int Xorriso_option_check_media(struct XorrisO *xorriso, int Xorriso_option_check_media(struct XorrisO *xorriso,
int argc, char **argv, int *idx, int flag) int argc, char **argv, int *idx, int flag)
{ {
int ret, i, count, lba, blocks, quality, pass, was_md5= 0, was_event= 0; int ret, i, count, lba, blocks, quality, pass, was_md5= 0, was_event= 0;
int end_idx, old_idx, os_errno; int end_idx, old_idx, os_errno, to_info= 0;
char quality_name[80], *head_buffer= NULL; char quality_name[80], *head_buffer= NULL;
struct SpotlisT *spotlist= NULL; struct SpotlisT *spotlist= NULL;
struct CheckmediajoB *job= NULL; struct CheckmediajoB *job= NULL;
struct FindjoB *findjob= NULL; struct FindjoB *findjob= NULL;
struct stat dir_stbuf; struct stat dir_stbuf;
old_idx= *idx; old_idx= *idx;
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1);
(*idx)= end_idx; (*idx)= end_idx;
Xorriso_alloc_meM(head_buffer, char, 64 * 1024); Xorriso_alloc_meM(head_buffer, char, 64 * 1024);
ret= Checkmediajob_new(&job, 0); ret= Checkmediajob_new(&job, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
ret= Xorriso_check_media_setup_job(xorriso, job, argv, old_idx, end_idx, 0); ret= Xorriso_check_media_setup_job(xorriso, job, argv, old_idx, end_idx, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
to_info= (strcmp(job->data_to_path, "-") == 0);
if((job->report_mode == 1 || job->report_mode == 2) && job->use_dev == 1) { if((job->report_mode == 1 || job->report_mode == 2) && job->use_dev == 1) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"-check_media: cannot report=*files while use=outdef"); "-check_media: cannot report=*files while use=outdef");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex; ret= 0; goto ex;
} }
if(job->patch_lba0 && job->data_to_path[0] == 0) { if(job->patch_lba0 && job->data_to_path[0] == 0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"-check_media: cannot apply patch_lba0= while data_to= has empty value"); "-check_media: cannot apply patch_lba0= while data_to= has empty value");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex; ret= 0; goto ex;
} }
if(job->patch_lba0 && to_info) {
sprintf(xorriso->info_text,
"-check_media: cannot apply patch_lba0= while data_to= is \"-\"");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
if(job->use_dev == 2) { if(job->use_dev == 2) {
if(job->sector_map_path[0] == 0) { if(job->sector_map_path[0] == 0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"-check_media: option use=sector_map but sector_map=''"); "-check_media: option use=sector_map but sector_map=''");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex; ret= 0; goto ex;
} }
ret= Sectorbitmap_from_file(&(job->sector_map), job->sector_map_path, ret= Sectorbitmap_from_file(&(job->sector_map), job->sector_map_path,
xorriso->info_text, &os_errno, 0); xorriso->info_text, &os_errno, 0);
skipping to change at line 1825 skipping to change at line 1832
for(pass= 0; pass < 2; pass++) { for(pass= 0; pass < 2; pass++) {
if(pass == 0) { if(pass == 0) {
sprintf(xorriso->result_line, sprintf(xorriso->result_line,
"Media checks : lba , size , quality\n"); "Media checks : lba , size , quality\n");
} else { } else {
if(!was_md5) if(!was_md5)
break; break;
sprintf(xorriso->result_line, sprintf(xorriso->result_line,
"MD5 checks : lba , size , result\n"); "MD5 checks : lba , size , result\n");
} }
Xorriso_result(xorriso,0); if(to_info) {
strcpy(xorriso->info_text, xorriso->result_line);
Xorriso_info(xorriso, 0);
} else {
Xorriso_result(xorriso, 0);
}
count= Spotlist_count(spotlist, 0); count= Spotlist_count(spotlist, 0);
for(i= 0; i < count; i++) { for(i= 0; i < count; i++) {
ret= Spotlist_get_item(spotlist, i, &lba, &blocks, &quality, 0); ret= Spotlist_get_item(spotlist, i, &lba, &blocks, &quality, 0);
if(ret <= 0) if(ret <= 0)
continue; continue;
if(pass == 0) { if(pass == 0) {
if(quality == Xorriso_read_quality_md5_mismatcH || if(quality == Xorriso_read_quality_md5_mismatcH ||
quality == Xorriso_read_quality_unreadablE) { quality == Xorriso_read_quality_unreadablE) {
was_event= 1; was_event= 1;
} }
skipping to change at line 1849 skipping to change at line 1861
continue; continue;
} }
} }
else if(pass == 1 && !(quality == Xorriso_read_quality_md5_matcH || else if(pass == 1 && !(quality == Xorriso_read_quality_md5_matcH ||
quality == Xorriso_read_quality_md5_mismatcH)) quality == Xorriso_read_quality_md5_mismatcH))
continue; continue;
sprintf(xorriso->result_line, "%s: %10d , %10d , %s\n", sprintf(xorriso->result_line, "%s: %10d , %10d , %s\n",
pass == 0 ? "Media region " : "MD5 tag range", pass == 0 ? "Media region " : "MD5 tag range",
lba, blocks, Spotlist__quality_name(quality, quality_name, lba, blocks, Spotlist__quality_name(quality, quality_name,
xorriso->check_media_bad_limit, 0)); xorriso->check_media_bad_limit, 0));
Xorriso_result(xorriso,0); if(to_info) {
strcpy(xorriso->info_text, xorriso->result_line);
Xorriso_info(xorriso, 0);
} else {
Xorriso_result(xorriso, 0);
}
} }
} }
} }
if(job->report_mode == 1 || job->report_mode == 2) { /* report files */ if(job->report_mode == 1 || job->report_mode == 2) { /* report files */
ret= Findjob_new(&findjob, "/", 0); ret= Findjob_new(&findjob, "/", 0);
if(ret<=0) { if(ret<=0) {
Xorriso_no_findjob(xorriso, "-check_media report=files", 0); Xorriso_no_findjob(xorriso, "-check_media report=files", 0);
{ret= -1; goto ex;} {ret= -1; goto ex;}
} }
Findjob_set_damage_filter(findjob, 1, 0); Findjob_set_damage_filter(findjob, 1, 0);
 End of changes. 5 change blocks. 
3 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)