summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-04-21 03:27:14 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-04-21 03:27:14 +0200
commitf907449eee3f58fafafee0658e80578b1dbb2722 (patch)
treea41848b96a1e2f8b425ec797673e9db26508fd47 /extras
parent540f46698dd5a3bed767fa1c761ead1c9e41ed2e (diff)
cdrom_id: add and use ID_CDROM_MEDIA to decide if we run vol_id
Some broken mobile phones offer a faked cdrom drive with a media without any tracks.
Diffstat (limited to 'extras')
-rw-r--r--extras/cdrom_id/cdrom_id.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index c578f12921..371d6a2dbd 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -76,6 +76,7 @@ static unsigned int cd_mrw;
static unsigned int cd_mrw_w;
/* media info */
+static unsigned int cd_media;
static unsigned int cd_media_cd_rom;
static unsigned int cd_media_cd_r;
static unsigned int cd_media_cd_rw;
@@ -325,6 +326,8 @@ static int cd_profiles(struct udev *udev, int fd)
return -1;
}
+ cd_media = 1;
+
switch (cur_profile) {
case 0x03:
case 0x04:
@@ -625,6 +628,8 @@ print:
if (cd_mrw_w)
printf("ID_CDROM_MRW_W=1\n");
+ if (cd_media)
+ printf("ID_CDROM_MEDIA=1\n");
if (cd_media_mo)
printf("ID_CDROM_MEDIA_MO=1\n");
if (cd_media_mrw)