From: Karel Zak Date: Wed, 8 Jan 2020 08:23:04 +0000 (+0100) Subject: libblkid: check status for the current CDROM slot X-Git-Tag: v2.35-rc2~5 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e72eea70c452cf1b820aae4b942e82ab5e0e7326;p=thirdparty%2Futil-linux.git libblkid: check status for the current CDROM slot It's probably more safer. Reported-by: Michal Suchánek Signed-off-by: Karel Zak --- diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index 871cd9bf21..a8c2d3b4da 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -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;