Made use of ISO_ERR_SEV() and ISO_ERR_PRIO()

This commit is contained in:
2008-02-03 13:16:18 +00:00
parent 0ce9be5c2d
commit eca39c33e0
6 changed files with 245 additions and 46 deletions

View File

@ -143,14 +143,18 @@ int isoburn_read_image(struct burn_drive *d,
return -1;
/* create a new image */
ret = iso_image_new("ISOIMAGE", image);
if (ret < 0)
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
return ret;
}
} else {
/* Blank new image for the drive */
iso_image_unref(o->image);
ret = iso_image_new("ISOIMAGE", &o->image);
if (ret < 0)
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
return ret;
}
if (image) {
*image = o->image;
iso_image_ref(*image); /*protects object from premature free*/
@ -173,8 +177,10 @@ int isoburn_read_image(struct burn_drive *d,
/* create the data source */
ret = iso_read_opts_new(&ropts, 0);
if (ret < 0)
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
return ret;
}
/* Important: do not return until iso_read_opts_free() */
iso_read_opts_set_start_block(ropts, ms_block);
iso_read_opts_set_no_rockridge(ropts, read_opts->norock);
@ -190,11 +196,13 @@ int isoburn_read_image(struct burn_drive *d,
ret = iso_image_import(o->image, ds, ropts, &features);
iso_read_opts_free(ropts);
iso_data_source_unref(ds);
if (ret < 0)
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot import image", 0, "FAILURE", 0);
return ret;
}
/* Important: do not return until free(features) */
if (image) {
if (image!=NULL) {
*image = o->image;
iso_image_ref(*image); /*protects object from premature free*/
}