mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 15:21:37 +03:00
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.
This commit is contained in:
parent
58e178894b
commit
30e3b1a0d3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user