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

View File

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