Hi, I found that ejecting mounted CDs on Linux works when running as
root only. The standard eject command, however, manages to eject such
discs even when running as a normal user (it does not run setuid root).
I spent some time trying to figure out why the libcdio code does not
work as expected, but didn't find a solution. Running the eject
utility in verbose mode you can see that it also fails trying standard
cdrom ioctls, but succeeds using SGIO commands. I tried using its SGIO
code in libcdio to no avail, however. Might try again in the future.
My temporary solution is to invoke the eject command directly if
ioctls and MMC commands fail. This is what the attached patch implements.
@Rocky: If you don't object I would like to push the patch to git in a
few days.
Btw., I'm having a similar problem with the ejection code on OS X that
I am yet to solve. The media_unmount_callback is never called (even
though unmounting works fine) and so it doesn't get to the actual
eject code. As a workaround, I'm currently calling
cdio_eject_media_drive twice with a small timeout inbetween on OS X,
but need to find a better solution / the reason why the callback does
not fire.
BR,
Robert
----
Robert Kausch
address@hidden