chiark / gitweb /
path_id: handle fibre channel
[elogind.git] / extras / cdrom_id / cdrom_id.c
index 0d873ae8e5f847eaba7df3d0bc6cc846e948a75d..2306d9ad716ae608eee4d3e651d15f40056bf6b4 100644 (file)
@@ -426,8 +426,10 @@ static int cd_media_info(struct udev *udev, int fd)
 
        info(udev, "disk type %02x\n", header[8]);
 
-       if ((header[2] & 3) < 4)
+       /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */
+       if (!cd_media_cd_rom && (header[2] & 3) < 4)
                cd_media_state = media_status[header[2] & 3];
+
        if ((header[2] & 3) != 2)
                cd_media_session_next = header[10] << 8 | header[5];
        cd_media_session_count = header[9] << 8 | header[4];
@@ -568,6 +570,7 @@ int main(int argc, char *argv[])
        fd = open(node, O_RDONLY | O_NONBLOCK);
        if (fd < 0) {
                info(udev, "unable to open '%s'\n", node);
+               fprintf(stderr, "unable to open '%s'\n", node);
                rc = 1;
                goto exit;
        }