From e6ba022cef0ab01bcfbd5ce2e0e3f93f6ee3376b Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Fri, 18 Dec 2015 11:15:01 +1100 Subject: discover: Fix dead code in udev_handle_cdrom_events() The check against ddev->mounted to cause an eject action is logically impossible. Change it so a cdrom_eject() is called properly. Change the return value to 'true' for any action caused by DISK_EJECT_REQUEST - no further action is appropriate in this case Signed-off-by: Samuel Mendoza-Jonas --- discover/udev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/discover/udev.c b/discover/udev.c index 6cc718e..537ef10 100644 --- a/discover/udev.c +++ b/discover/udev.c @@ -245,13 +245,12 @@ static bool udev_handle_cdrom_events(struct pb_udev *udev, struct udev_device *dev, struct discover_device *ddev) { const char *node; + bool eject = false; node = udev_device_get_devnode(dev); /* handle CDROM eject requests */ if (udev_device_get_property_value(dev, "DISK_EJECT_REQUEST")) { - bool eject = false; - pb_debug("udev: eject request\n"); /* If the device is mounted, cdrom_id's own eject request may @@ -260,7 +259,6 @@ static bool udev_handle_cdrom_events(struct pb_udev *udev, if (ddev) { eject = ddev->mounted; udev_handle_dev_remove(udev, dev); - return false; } if (eject) -- cgit v1.1