Comment 16 for bug 1168742

Revision history for this message
In , Tbzatek (tbzatek) wrote :

Created attachment 92238
[PATCH] Check if cdrom drive has media on cleanup

When cleanup is run, it is supposed to remove lingering mounts.
That probably works fine for card readers etc. since there's
a partition exposed for the drive but fails for optical media.
As a result, when mounted and user presses the drive eject
button, tray is ejected but mounts lives on.

This patch adds a special check for CDROM drives and looks for
active media.

--

The test is highly cdrom-specific and should not break anything else. On the other hand, not sure if there are e.g. card readers not exposing the "partition" device type, only presenting itself as a "disk". Haven't tested that, my concern was a flash medium having no partition table, used directly. Or, a ZIP drive (ATAPI vs. floppy mode) and such...