Inserted problem messages where libisoburn API produces own failures
This commit is contained in:
@ -116,19 +116,15 @@ int isoburn_read_image(struct burn_drive *d,
|
||||
struct isoburn *o= NULL;
|
||||
|
||||
if(read_opts==NULL) {
|
||||
|
||||
/* >>> program error */;
|
||||
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Program error: isoburn_read_image: read_opts==NULL",
|
||||
0, "FATAL", NULL);
|
||||
return(-1);
|
||||
}
|
||||
if(d != NULL) {
|
||||
ret = isoburn_find_emulator(&o, d, 0);
|
||||
if (ret < 0)
|
||||
if (ret < 0 || o == NULL)
|
||||
return 0;
|
||||
|
||||
if (o == NULL) {
|
||||
return -1;
|
||||
}
|
||||
status = isoburn_disc_get_status(d);
|
||||
}
|
||||
if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) {
|
||||
@ -139,8 +135,12 @@ int isoburn_read_image(struct burn_drive *d,
|
||||
|
||||
if (d == NULL) {
|
||||
/* New empty image without relation to a drive */
|
||||
if (image==NULL)
|
||||
if (image==NULL) {
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Program error: isoburn_read_image: image==NULL",
|
||||
0, "FATAL", NULL);
|
||||
return -1;
|
||||
}
|
||||
/* create a new image */
|
||||
ret = iso_image_new("ISOIMAGE", image);
|
||||
if (ret < 0) {
|
||||
@ -164,14 +164,16 @@ int isoburn_read_image(struct burn_drive *d,
|
||||
}
|
||||
|
||||
if (status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL) {
|
||||
/* incorrect disc status */
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Program error: isoburn_read_image: incorrect disc status",
|
||||
0, "FATAL", NULL);
|
||||
return -4;
|
||||
}
|
||||
|
||||
memset((char *) &ropts, 0, sizeof(ropts));
|
||||
|
||||
ret = isoburn_disc_get_msc1(d, &int_num);
|
||||
if (ret < 0)
|
||||
if (ret <= 0)
|
||||
return -2;
|
||||
ms_block= int_num;
|
||||
|
||||
@ -233,13 +235,15 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
if (image == NULL)
|
||||
if (image == NULL) {
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Program error: isoburn_attach_image: image==NULL",
|
||||
0, "FATAL", NULL);
|
||||
return -1;
|
||||
}
|
||||
ret = isoburn_find_emulator(&o, d, 0);
|
||||
if (ret < 0)
|
||||
if (ret < 0 || o == NULL)
|
||||
return 0;
|
||||
if (o == NULL)
|
||||
return -1;
|
||||
if(o->image != NULL)
|
||||
iso_image_unref(o->image);
|
||||
o->image = image;
|
||||
@ -284,8 +288,12 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
|
||||
struct burn_drive *drive;
|
||||
struct ecma119_pri_vol_desc *pvm;
|
||||
|
||||
if(o==NULL)
|
||||
if(o==NULL) {
|
||||
burn_msgs_submit(0x00060000,
|
||||
"Program error: isoburn_start_emulation: o==NULL",
|
||||
0, "FATAL", NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
drive= o->drive;
|
||||
|
||||
|
Reference in New Issue
Block a user