From 0919b40ae993f615b1a78623109cfb15288d9ac2 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 22 Sep 2007 15:50:27 +0000 Subject: [PATCH] Made use of burn_msgs_submit() for error messages --- src/burn_wrap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/burn_wrap.c b/src/burn_wrap.c index 146ffc03..ea791cd8 100644 --- a/src/burn_wrap.c +++ b/src/burn_wrap.c @@ -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; }