New option -close_damaged
This commit is contained in:
@ -2513,3 +2513,40 @@ ex:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* @param flag bit0=force burn_disc_close_damaged()
|
||||
*/
|
||||
int Xorriso_close_damaged(struct XorrisO *xorriso, int flag)
|
||||
{
|
||||
int ret;
|
||||
struct burn_drive_info *dinfo;
|
||||
struct burn_drive *drive;
|
||||
struct burn_write_opts *burn_options= NULL;
|
||||
|
||||
if(xorriso->volset_change_pending) {
|
||||
sprintf(xorriso->info_text,
|
||||
"Image changes pending. -commit or -rollback first");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
|
||||
"on attempt to closed damaged session", 2);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
ret= burn_disc_close_damaged(burn_options, flag & 1);
|
||||
Xorriso_process_msg_queues(xorriso, 0);
|
||||
Xorriso_option_dev(xorriso, "", 3 | 4); /* Give up drives */
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
|
||||
ret= 1;
|
||||
ex:;
|
||||
Xorriso_process_msg_queues(xorriso, 0);
|
||||
if(burn_options != NULL)
|
||||
burn_write_opts_free(burn_options);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user