Include file (see linux/cdrom.h lines 395 and 398) suggests ioctl() can
return CDS_NO_INFO and CDS_DRIVE_NOT_READY, which where ignored. This
commit will tell user what is going on.
The commit will also make eject to crash in ioctl() will return
unexpected value.
Reference: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=include/linux/cdrom.h;h=
dfd7f187c351440d2ffa81050e46ed2602877f73;hb=HEAD
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
if (eject_cdrom(fd))
err(EXIT_FAILURE, _("CD-ROM eject command failed"));
return;
+ case CDS_NO_INFO:
+ warnx(_("no CD-ROM information available"));
+ return;
+ case CDS_DRIVE_NOT_READY:
+ warnx(_("CD-ROM drive is not ready"));
+ return;
+ default:
+ abort();
}
#endif