Corrected behavior around image data read error
This commit is contained in:
parent
ad29faa0d1
commit
c723feda55
@ -3881,6 +3881,7 @@ much_too_long:;
|
|||||||
@param flag bit0= mtimes of both file objects are equal
|
@param flag bit0= mtimes of both file objects are equal
|
||||||
bit29= do not issue pacifier messages
|
bit29= do not issue pacifier messages
|
||||||
bit31= do not issue result messages
|
bit31= do not issue result messages
|
||||||
|
@return >0 ok , <=0 error
|
||||||
*/
|
*/
|
||||||
int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr,
|
int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr,
|
||||||
char *disk_adr, off_t disk_size,
|
char *disk_adr, off_t disk_size,
|
||||||
@ -3888,7 +3889,7 @@ int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr,
|
|||||||
char *iso_adr, off_t iso_size,
|
char *iso_adr, off_t iso_size,
|
||||||
int *result, int flag)
|
int *result, int flag)
|
||||||
{
|
{
|
||||||
int fd1= -1, ret, r1, r2, done, wanted, i;
|
int fd1= -1, ret, r1, r2, done, wanted, i, was_error= 0;
|
||||||
void *stream2= NULL;
|
void *stream2= NULL;
|
||||||
off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
|
off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
|
||||||
char *respt, buf1[32*1024], buf2[32*1024], offset_text[80];
|
char *respt, buf1[32*1024], buf2[32*1024], offset_text[80];
|
||||||
@ -3952,6 +3953,9 @@ cannot_address:;
|
|||||||
else
|
else
|
||||||
r2= 0;
|
r2= 0;
|
||||||
|
|
||||||
|
if(r1<0 || r2<0)
|
||||||
|
was_error= 1;
|
||||||
|
|
||||||
if(r1<=0 && r2<=0)
|
if(r1<=0 && r2<=0)
|
||||||
break;
|
break;
|
||||||
if(r1<=0) {
|
if(r1<=0) {
|
||||||
@ -4024,6 +4028,8 @@ cannot_address:;
|
|||||||
if(fd1!=-1)
|
if(fd1!=-1)
|
||||||
close(fd1);
|
close(fd1);
|
||||||
Xorriso_iso_file_close(xorriso, &stream2, 0);
|
Xorriso_iso_file_close(xorriso, &stream2, 0);
|
||||||
|
if(was_error)
|
||||||
|
return(-1);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4064,7 +4070,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
|||||||
int *result, int flag)
|
int *result, int flag)
|
||||||
{
|
{
|
||||||
struct stat s1, s2, stbuf;
|
struct stat s1, s2, stbuf;
|
||||||
int ret, missing= 0, is_split= 0, i;
|
int ret, missing= 0, is_split= 0, i, was_error= 0;
|
||||||
char *respt;
|
char *respt;
|
||||||
char a[5*SfileadrL], sfe[5*SfileadrL];
|
char a[5*SfileadrL], sfe[5*SfileadrL];
|
||||||
char ttx1[40], ttx2[40];
|
char ttx1[40], ttx2[40];
|
||||||
@ -4228,6 +4234,8 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
|||||||
offset, bytes,
|
offset, bytes,
|
||||||
part_path, stbuf.st_size, result,
|
part_path, stbuf.st_size, result,
|
||||||
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
|
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
|
||||||
|
if(ret<0)
|
||||||
|
was_error= 1;
|
||||||
}
|
}
|
||||||
if(total_parts>0 && split_count!=total_parts) {
|
if(total_parts>0 && split_count!=total_parts) {
|
||||||
sprintf(xorriso->info_text,
|
sprintf(xorriso->info_text,
|
||||||
@ -4242,11 +4250,15 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
|||||||
(off_t) 0, s1.st_size,
|
(off_t) 0, s1.st_size,
|
||||||
iso_adr, s2.st_size, result,
|
iso_adr, s2.st_size, result,
|
||||||
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
|
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
|
||||||
|
if(ret<0)
|
||||||
|
was_error= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if(was_error)
|
||||||
ret= (((*result)&~((1<<17)|(1<<18)))==0);
|
ret= -1;
|
||||||
|
else
|
||||||
|
ret= (((*result)&~((1<<17)|(1<<18)))==0);
|
||||||
ex:;
|
ex:;
|
||||||
if(split_parts!=NULL)
|
if(split_parts!=NULL)
|
||||||
Splitparts_destroy(&split_parts, split_count, 0);
|
Splitparts_destroy(&split_parts, split_count, 0);
|
||||||
@ -4291,7 +4303,10 @@ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter,
|
|||||||
if(ret<xorriso->find_compare_result)
|
if(ret<xorriso->find_compare_result)
|
||||||
xorriso->find_compare_result= ret;
|
xorriso->find_compare_result= ret;
|
||||||
if(flag&1) {
|
if(flag&1) {
|
||||||
if(ret==0) {
|
if(ret<=0) {
|
||||||
|
if(ret<0)
|
||||||
|
if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0)
|
||||||
|
return(ret);
|
||||||
uret= Xorriso_update_interpreter(xorriso, boss_iter, result,
|
uret= Xorriso_update_interpreter(xorriso, boss_iter, result,
|
||||||
disk_path, iso_path, (flag&2)<<1);
|
disk_path, iso_path, (flag&2)<<1);
|
||||||
if(uret<=0)
|
if(uret<=0)
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.04.08.153508"
|
#define Xorriso_timestamP "2008.04.09.114815"
|
||||||
|
@ -365,6 +365,7 @@ int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
|
|||||||
|
|
||||||
/* @param flag bit0= report libisofs error text
|
/* @param flag bit0= report libisofs error text
|
||||||
bit1= victim is disk_path
|
bit1= victim is disk_path
|
||||||
|
bit2= do not inquire libisofs, report msg_text and min_severity
|
||||||
*/
|
*/
|
||||||
int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
|
int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
|
||||||
int iso_error_code, char msg_text[], int os_errno,
|
int iso_error_code, char msg_text[], int os_errno,
|
||||||
@ -378,21 +379,25 @@ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
|
|||||||
if(sorry_sev<0)
|
if(sorry_sev<0)
|
||||||
Xorriso__text_to_sev("SORRY", &sorry_sev, 0);
|
Xorriso__text_to_sev("SORRY", &sorry_sev, 0);
|
||||||
|
|
||||||
error_code= iso_error_get_code(iso_error_code);
|
if(flag&4) {
|
||||||
if(error_code < 0x00030000 || error_code >= 0x00040000)
|
error_code= 0x00050000;
|
||||||
error_code= (error_code & 0xffff) | 0x00050000;
|
Xorriso__text_to_sev(min_severity, &iso_sev, 0);
|
||||||
|
} else {
|
||||||
if(flag&1)
|
error_code= iso_error_get_code(iso_error_code);
|
||||||
msg_text_pt= (char *) iso_error_to_msg(iso_error_code);
|
if(error_code < 0x00030000 || error_code >= 0x00040000)
|
||||||
|
error_code= (error_code & 0xffff) | 0x00050000;
|
||||||
|
if(flag&1)
|
||||||
|
msg_text_pt= (char *) iso_error_to_msg(iso_error_code);
|
||||||
|
iso_sev= iso_error_get_severity(iso_error_code);
|
||||||
|
}
|
||||||
if(msg_text_pt==NULL)
|
if(msg_text_pt==NULL)
|
||||||
msg_text_pt= msg_text;
|
msg_text_pt= msg_text;
|
||||||
iso_sev= iso_error_get_severity(iso_error_code);
|
|
||||||
|
|
||||||
if(iso_sev >= sorry_sev && (flag & 2) && victim[0])
|
if(iso_sev >= sorry_sev && (flag & 2) && victim[0])
|
||||||
Xorriso_msgs_submit(xorriso, 0, victim, 0, "ERRFILE", 0);
|
Xorriso_msgs_submit(xorriso, 0, victim, 0, "ERRFILE", 0);
|
||||||
sev_text_pt= min_severity;
|
sev_text_pt= min_severity;
|
||||||
Xorriso__text_to_sev(min_severity, &min_sev, 0);
|
Xorriso__text_to_sev(min_severity, &min_sev, 0);
|
||||||
if(min_sev < iso_sev)
|
if(min_sev < iso_sev && !(flag&4))
|
||||||
Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0);
|
Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0);
|
||||||
strcpy(sfe, msg_text_pt);
|
strcpy(sfe, msg_text_pt);
|
||||||
if(victim[0]) {
|
if(victim[0]) {
|
||||||
@ -4781,7 +4786,7 @@ int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf,
|
|||||||
if(ret<0) { /* error */
|
if(ret<0) { /* error */
|
||||||
Xorriso_process_msg_queues(xorriso,0);
|
Xorriso_process_msg_queues(xorriso,0);
|
||||||
Xorriso_report_iso_error(xorriso, "", ret, "Error on read",
|
Xorriso_report_iso_error(xorriso, "", ret, "Error on read",
|
||||||
0, "FAILURE",1);
|
0, "FAILURE", 1 | ((ret == -1)<<2) );
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
rcnt+= ret;
|
rcnt+= ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user