module/removables: log warning if action is something we didn't expect

This commit is contained in:
Daniel Eklöf 2019-01-01 20:30:27 +01:00
parent 410b7635d7
commit a8a9ab28bd

View file

@ -350,7 +350,10 @@ handle_udev_event(struct module *mod, struct udev_device *dev)
bool add = strcmp(action, "add") == 0;
bool del = strcmp(action, "remove") == 0;
assert(add || del);
if (!add && !del) {
LOG_WARN("unhandled action: %s", action);
return false;
}
const char *devtype = udev_device_get_property_value(dev, "DEVTYPE");