libblkid: check status for the current CDROM slot

It's probably more safer.

Reported-by: Michal Suchánek <msuchanek@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2020-01-08 09:23:04 +01:00
parent dc30fd4383
commit e72eea70c4
1 changed files with 1 additions and 1 deletions

View File

@ -946,7 +946,7 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
ioctl(fd, CDROM_GET_CAPABILITY, NULL) >= 0) {
# ifdef CDROM_DRIVE_STATUS
switch (ioctl(fd, CDROM_DRIVE_STATUS, 0)) {
switch (ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) {
case CDS_TRAY_OPEN:
case CDS_NO_DISC:
errno = ENOMEDIUM;