Made use of burn_msgs_submit() for error messages

This commit is contained in:
Thomas Schmitt 2007-09-22 15:50:27 +00:00
parent 4b1bcb6a37
commit 0919b40ae9
1 changed files with 8 additions and 9 deletions

View File

@ -93,6 +93,7 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
struct stat stbuf;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN], *adrpt, *stdio_adr= NULL;
struct isoburn *o= NULL;
char msg[BURN_MSGS_MESSAGE_LEN+4096];
/* Treatment decision criteria
Prefixes "grow:" leads to: treatment 1, image growing
@ -122,10 +123,9 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
treatment= 2;
if(stat(adrpt,&stbuf)!=-1) {
if(! S_ISREG(stbuf.st_mode)) {
/* >>> we need a gateway to the libisofs/libburn message system */;
fprintf(stderr, "LIBISOBURN: unsuitable target for modify: '%s'\n",adr);
sprintf(msg, "Unsuitable target for modify: '%s'\n",adr);
msg[BURN_MSGS_MESSAGE_LEN]= 0;
burn_msgs_submit(0, msg, 0, "SORRY", NULL);
ret= 0; goto ex;
}
}
@ -156,11 +156,10 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
}
}
}
if(conv_ret<=0 || treatment<=0) { /* Failure */
/* >>> we need a gateway to the libisofs/libburn message system */;
fprintf(stderr, "LIBISOBURN: unsuitable drive address: '%s'\n", adrpt);
if(conv_ret<=0 || treatment<=0) {
sprintf(msg, "Unsuitable drive address: '%s'\n",adrpt);
msg[BURN_MSGS_MESSAGE_LEN]= 0;
burn_msgs_submit(0, msg, 0, "SORRY", NULL);
ret= 0; goto ex;
}