diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2010-04-15 21:25:57 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2010-04-15 21:29:18 +0200 |
commit | 30e3b1a0d3a3ec76f16736470dc656744848d941 (patch) | |
tree | f0bcc6f8621dcdca41d1c0563f99601ec52bc20d /extras | |
parent | 58e178894bfc040834e1270c6fe9b9fdef513550 (diff) |
cdrom_id: Swap media state and TOC info probing
Blank CDs do not have a TOC, thus will fail cd_media_toc() (at least with the
"Do not ignore errors from scsi_cmd_run()" fix). Thus probe the media state
first, so that we can properly detect blank media.
Diffstat (limited to 'extras')
-rw-r--r-- | extras/cdrom_id/cdrom_id.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c index 37212e9794..722b8f8f45 100644 --- a/extras/cdrom_id/cdrom_id.c +++ b/extras/cdrom_id/cdrom_id.c @@ -681,14 +681,14 @@ int main(int argc, char *argv[]) if (cd_profiles(udev, fd) < 0) goto print; - /* get session/track info */ - if (cd_media_toc(udev, fd) < 0) - goto print; - /* get writable media state */ if (cd_media_info(udev, fd) < 0) goto print; + /* get session/track info */ + if (cd_media_toc(udev, fd) < 0) + goto print; + print: printf("ID_CDROM=1\n"); if (cd_cd_rom) |