Made use of libburn device address translation (/dev/sr0, /dev/cdrom, ...)

This commit is contained in:
Thomas Schmitt 2006-11-25 15:43:31 +00:00
parent f2dacbf9e0
commit 7b6f2b2337
2 changed files with 25 additions and 7 deletions

View File

@ -107,12 +107,21 @@ int libburner_aquire_drive(char *drive_adr, int *driveno)
int libburner_aquire_by_adr(char *drive_adr) int libburner_aquire_by_adr(char *drive_adr)
{ {
int ret; int ret;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
printf("Aquiring drive '%s' ...\n",drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,drive_adr,1); /* This tries to resolve links or alternative device files */
ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr);
if (ret<=0) {
fprintf(stderr,"Address does not lead to a CD burner: '%s'\n",
drive_adr);
return ret;
}
printf("Aquiring drive '%s' ...\n",libburn_drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,libburn_drive_adr,1);
if (ret <= 0) { if (ret <= 0) {
fprintf(stderr,"FAILURE with persistent drive address '%s'\n", fprintf(stderr,"FAILURE with persistent drive address '%s'\n",
drive_adr); libburn_drive_adr);
} else { } else {
printf("Done\n"); printf("Done\n");
drive_is_grabbed = 1; drive_is_grabbed = 1;

View File

@ -105,11 +105,20 @@ int telltoc_aquire_by_adr(char *drive_adr)
{ {
int ret; int ret;
fprintf(stderr,"Aquiring drive '%s' ...\n",drive_adr); char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
ret = burn_drive_scan_and_grab(&drive_list,drive_adr,1);
/* This tries to resolve links or alternative device files */
ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr);
if (ret<=0) {
fprintf(stderr,"Address does not lead to a CD burner: '%s'\n",
drive_adr);
return ret;
}
fprintf(stderr,"Aquiring drive '%s' ...\n",libburn_drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,libburn_drive_adr,1);
if (ret <= 0) { if (ret <= 0) {
fprintf(stderr,"FAILURE with persistent drive address '%s'\n", fprintf(stderr,"FAILURE with persistent drive address '%s'\n",
drive_adr); libburn_drive_adr);
} else { } else {
fprintf(stderr,"Done\n"); fprintf(stderr,"Done\n");
drive_is_grabbed = 1; drive_is_grabbed = 1;