Corrected behavior around image data read error
This commit is contained in:
@ -365,6 +365,7 @@ int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
|
||||
|
||||
/* @param flag bit0= report libisofs error text
|
||||
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 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)
|
||||
Xorriso__text_to_sev("SORRY", &sorry_sev, 0);
|
||||
|
||||
error_code= iso_error_get_code(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);
|
||||
if(flag&4) {
|
||||
error_code= 0x00050000;
|
||||
Xorriso__text_to_sev(min_severity, &iso_sev, 0);
|
||||
} else {
|
||||
error_code= iso_error_get_code(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)
|
||||
msg_text_pt= msg_text;
|
||||
iso_sev= iso_error_get_severity(iso_error_code);
|
||||
|
||||
if(iso_sev >= sorry_sev && (flag & 2) && victim[0])
|
||||
Xorriso_msgs_submit(xorriso, 0, victim, 0, "ERRFILE", 0);
|
||||
sev_text_pt= min_severity;
|
||||
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);
|
||||
strcpy(sfe, msg_text_pt);
|
||||
if(victim[0]) {
|
||||
@ -4781,7 +4786,7 @@ int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf,
|
||||
if(ret<0) { /* error */
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
Xorriso_report_iso_error(xorriso, "", ret, "Error on read",
|
||||
0, "FAILURE",1);
|
||||
0, "FAILURE", 1 | ((ret == -1)<<2) );
|
||||
return(-1);
|
||||
}
|
||||
rcnt+= ret;
|
||||
|
Reference in New Issue
Block a user