summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-12-18 11:15:01 +1100
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-12-18 11:15:01 +1100
commite6ba022cef0ab01bcfbd5ce2e0e3f93f6ee3376b (patch)
tree0ed4c78aad2c67321adc70321a9cddcd8a7d57c9
parentc9c964c8c03c766d94d4798231d6e3db191c57df (diff)
downloadpetitboot-e6ba022cef0ab01bcfbd5ce2e0e3f93f6ee3376b.zip
petitboot-e6ba022cef0ab01bcfbd5ce2e0e3f93f6ee3376b.tar.gz
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 <sam.mj@au1.ibm.com>
-rw-r--r--discover/udev.c4
1 files changed, 1 insertions, 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)
OpenPOWER on IntegriCloud