From: Martin Pitt Date: Mon, 30 Aug 2010 13:33:26 +0000 (+0200) Subject: cdrom_id: Fix DVD-RW media detection X-Git-Tag: 174~354 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=2458db3edd8d66827b34978ff471dff8f879e9ab cdrom_id: Fix DVD-RW media detection Commit cf2205a19 applied the "restricted overwrite" vs. "sequential" DVD-RW test to feature_profiles() (which reads the drive capabilities), which caused every DVD medium to be detected as ID_CDROM_MEDIA_DVD_RW. Now apply it to cd_profiles() instead, to just check the current profile. --- diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c index f9d6e0bc2..8480d7b33 100644 --- a/extras/cdrom_id/cdrom_id.c +++ b/extras/cdrom_id/cdrom_id.c @@ -297,14 +297,9 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si cd_dvd_ram = 1; break; case 0x13: - info(udev, "profile 0x%02x media_dvd_rw\n", profile); - cd_media_dvd_rw = 1; - cd_media_dvd_rw_ro = 1; - break; case 0x14: info(udev, "profile 0x%02x dvd_rw\n", profile); cd_dvd_rw = 1; - cd_media_dvd_rw_seq = 1; break; case 0x1B: info(udev, "profile 0x%02x dvd_plus_r\n", profile); @@ -486,10 +481,16 @@ static int cd_profiles(struct udev *udev, int fd) cd_media_dvd_ram = 1; break; case 0x13: + info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); + cd_media = 1; + cd_media_dvd_rw = 1; + cd_media_dvd_rw_ro = 1; + break; case 0x14: - info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile); + info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); cd_media = 1; cd_media_dvd_rw = 1; + cd_media_dvd_rw_seq = 1; break; case 0x1B: info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);