Simon McVittie : winebus.sys: Treat udev actions other than "remove" as "add".
Alexandre Julliard
julliard at winehq.org
Wed Oct 20 15:58:39 CDT 2021
Module: wine
Branch: master
Commit: 22dae167d326036ef3b91eb1d5c45acdaa89eb0c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=22dae167d326036ef3b91eb1d5c45acdaa89eb0c
Author: Simon McVittie <smcv at collabora.com>
Date: Wed Oct 20 11:07:26 2021 +0200
winebus.sys: Treat udev actions other than "remove" as "add".
As per https://github.com/systemd/systemd/blob/v247-rc1/NEWS#L5
there are more kernel uevent types than just "add" and "remove",
and we should be treating everything other than "remove" as being
potentially an "add".
To cope with this, try_add_device() now checks whether the same device
was already added. If so, we ignore it.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winebus.sys/bus_udev.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 1dfce05e4bc..57e5a169a69 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -1404,16 +1404,14 @@ static void process_monitor_event(struct udev_monitor *monitor)
if (!action)
WARN("No action received\n");
- else if (strcmp(action, "add") == 0)
+ else if (strcmp(action, "remove"))
udev_add_device(dev);
- else if (strcmp(action, "remove") == 0)
+ else
{
impl = find_device_from_udev(dev);
if (impl) bus_event_queue_device_removed(&event_queue, &impl->unix_device);
else WARN("failed to find device for udev device %p\n", dev);
}
- else
- WARN("Unhandled action %s\n", debugstr_a(action));
udev_device_unref(dev);
}
More information about the wine-cvs
mailing list