1.1 --- a/src/drivers/cd_linux.c Mon Jul 14 07:44:42 2008 +0000
1.2 +++ b/src/drivers/cd_linux.c Thu Jul 24 02:31:56 2008 +0000
1.4 return FALSE; /* Not a block device */
1.7 - if( ioctl(fileno(f), CDROMREADTOCHDR, &tochdr) == -1 ) {
1.8 - /* Quick check that this is really a CD */
1.9 + int caps = ioctl(fileno(f), CDROM_GET_CAPABILITY);
1.10 + if( caps == -1 ) {
1.11 + /* Quick check that this is really a CD device */
1.15 @@ -117,16 +118,21 @@
1.19 - gdrom_error_t status = linux_read_disc_toc( (gdrom_image_t)disc );
1.20 - if( status != 0 ) {
1.21 - gdrom_image_destroy_no_close(disc);
1.22 - if( status == 0xFFFF ) {
1.23 - ERROR("Unable to load disc table of contents (%s)", strerror(errno));
1.25 - ERROR("Unable to load disc table of contents (sense %d,%d)",
1.26 + int status = ioctl(fileno(f), CDROM_DRIVE_STATUS, CDSL_CURRENT);
1.27 + if( status == CDS_DISC_OK ) {
1.28 + status = linux_read_disc_toc( (gdrom_image_t)disc );
1.29 + if( status != 0 ) {
1.30 + gdrom_image_destroy_no_close(disc);
1.31 + if( status == 0xFFFF ) {
1.32 + ERROR("Unable to load disc table of contents (%s)", strerror(errno));
1.34 + ERROR("Unable to load disc table of contents (sense %d,%d)",
1.35 status &0xFF, status >> 8 );
1.41 + ((gdrom_image_t)disc)->disc_type = IDE_DISC_NONE;
1.43 disc->read_sector = linux_read_sector;
1.44 disc->drive_status = linux_drive_status;