chiark / gitweb /
cdrom_id: Don't ignore profiles when there is no media available
authorDavid Zeuthen <davidz@redhat.com>
Tue, 15 Mar 2011 16:05:00 +0000 (12:05 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 15 Mar 2011 16:33:35 +0000 (12:33 -0400)
commit98ab6a377285d5943563cfa397e8b350e43878ec
treeeaec8f252dbdd483790fed66d926cdbd55e52cb0
parent5f59fa0900a5c127ce1a25d8ba3176f166662f96
cdrom_id: Don't ignore profiles when there is no media available

Just because the GET CONFIGURATION MMC-2 command returns the current
profile as 0 does not mean that we can ignore the profiles describing
the capabilities of the drive - it only means that there currently is
no recognized media in the drive. Therefore, do process the returned
profiles even when cur_profile is 0.

This fixes a bug where only

 ID_CDROM=1
 ID_CDROM_CD_R=1
 ID_CDROM_CD_RW=1
 ID_CDROM_DVD=1
 ID_CDROM_DVD_R=1
 ID_CDROM_DVD_RAM=1

was returned when there is no media in the drive instead of

 ID_CDROM=1
 ID_CDROM_CD=1
 ID_CDROM_CD_R=1
 ID_CDROM_CD_RW=1
 ID_CDROM_DVD=1
 ID_CDROM_DVD_R=1
 ID_CDROM_DVD_RW=1
 ID_CDROM_DVD_RAM=1
 ID_CDROM_DVD_PLUS_R=1
 ID_CDROM_DVD_PLUS_RW=1
 ID_CDROM_DVD_PLUS_R_DL=1
 ID_CDROM_BD=1
 ID_CDROM_BD_R=1
 ID_CDROM_BD_RE=1
 ID_CDROM_HDDVD=1

as is returned now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
extras/cdrom_id/cdrom_id.c