--force-generic-device -g is an alias for --force-cdrom-device -d

This commit is contained in:
rocky
2005-01-18 12:26:06 +00:00
parent 63217964d6
commit 79ba6afcbb
2 changed files with 34 additions and 35 deletions

View File

@@ -585,7 +585,6 @@ static cdrom_drive_t *d = NULL;
static cdrom_paranoia_t *p = NULL; static cdrom_paranoia_t *p = NULL;
static char *span = NULL; static char *span = NULL;
static char *force_cdrom_device = NULL; static char *force_cdrom_device = NULL;
static char *force_generic_device = NULL;
static char *info_file = NULL; static char *info_file = NULL;
#define free_and_null(p) \ #define free_and_null(p) \
@@ -598,7 +597,6 @@ cleanup (void)
if (p) paranoia_free(p); if (p) paranoia_free(p);
if (d) cdda_close(d); if (d) cdda_close(d);
free_and_null(force_cdrom_device); free_and_null(force_cdrom_device);
free_and_null(force_generic_device);
free_and_null(span); free_and_null(span);
free_and_null(info_file); free_and_null(info_file);
} }
@@ -647,13 +645,15 @@ main(int argc,char *argv[])
case 'o': case 'o':
force_cdrom_overlap=atoi(optarg); force_cdrom_overlap=atoi(optarg);
break; break;
case 'd':
if(force_cdrom_device)free(force_cdrom_device);
force_cdrom_device=strdup(optarg);
break;
case 'g': case 'g':
if (force_generic_device) free(force_generic_device); case 'd':
force_generic_device=strdup(optarg); if (force_cdrom_device) {
fprintf(stderr,
"Multiple cdrom devices given. Previous device %s ignored\n",
force_cdrom_device);
free(force_cdrom_device);
}
force_cdrom_device=strdup(optarg);
break; break;
case 'S': case 'S':
force_cdrom_speed=atoi(optarg); force_cdrom_speed=atoi(optarg);
@@ -695,7 +695,8 @@ main(int argc,char *argv[])
break; break;
case 'e': case 'e':
callscript=1; callscript=1;
fprintf(stderr,"Sending all callcaks to stderr for wrapper script\n"); fprintf(stderr,
"Sending all callback output to stderr for wrapper script\n");
break; break;
case 'V': case 'V':
fprintf(stderr,PARANOIA_VERSION); fprintf(stderr,PARANOIA_VERSION);
@@ -771,37 +772,34 @@ main(int argc,char *argv[])
/* Query the cdrom/disc; we may need to override some settings */ /* Query the cdrom/disc; we may need to override some settings */
if (force_generic_device) if(force_cdrom_device)
d = cdda_identify (force_generic_device, verbose, NULL); d=cdda_identify(force_cdrom_device,verbose,NULL);
else else {
if(force_cdrom_device) driver_id_t driver_id;
d=cdda_identify(force_cdrom_device,verbose,NULL); char **ppsz_cd_drives = cdio_get_devices_with_cap_ret(NULL,
else { CDIO_FS_AUDIO,
driver_id_t driver_id; false,
char **ppsz_cd_drives = cdio_get_devices_with_cap_ret(NULL, &driver_id);
CDIO_FS_AUDIO, if (ppsz_cd_drives && *ppsz_cd_drives) {
false, d=cdda_identify(*ppsz_cd_drives,verbose, NULL);
&driver_id); } else {
if (ppsz_cd_drives && *ppsz_cd_drives) { report("\nUnable find or access a CD-ROM drive with an audio CD"
d=cdda_identify(*ppsz_cd_drives,verbose, NULL); " in it.");
} else { report("\nYou might try specifying the drive, especially if it has"
report("\nUnable find or access a CD-ROM drive with an audio CD" " mixed-mode (and non-audio) format tracks");
" in it."); exit(1);
report("\nYou might try specifying the drive, especially if it has"
" mixed-mode (and non-audio) format tracks");
exit(1);
}
cdio_free_device_list(ppsz_cd_drives);
free(ppsz_cd_drives);
} }
cdio_free_device_list(ppsz_cd_drives);
free(ppsz_cd_drives);
}
if(!d){ if(!d){
if(!verbose) if(!verbose)
report("\nUnable to open cdrom drive; -v might give more information."); report("\nUnable to open cdrom drive; -v might give more information.");
exit(1); exit(1);
} }
if(verbose) if(verbose)
cdda_verbose_set(d,CDDA_MESSAGE_PRINTIT,CDDA_MESSAGE_PRINTIT); cdda_verbose_set(d,CDDA_MESSAGE_PRINTIT,CDDA_MESSAGE_PRINTIT);
else else

View File

@@ -29,7 +29,8 @@ OPTIONS:
verification to n sectors verification to n sectors
-d --force-cdrom-device <dev> : use specified device; disallow -d --force-cdrom-device <dev> : use specified device; disallow
autosense autosense
-g --force-generic-device <dev> : use specified generic scsi device -g --force-generic-device <dev> : really an alias for -d. Kept for
compatibility.
-S --force-read-speed <n> : read from device at specified speed -S --force-read-speed <n> : read from device at specified speed
-t --toc-offset <n> : Add <n> sectors to the values reported -t --toc-offset <n> : Add <n> sectors to the values reported
when addressing tracks. May be negative when addressing tracks. May be negative