Commit bf2ca502 authored by Keith Packard's avatar Keith Packard Committed by Peter Hutterer

config: Hold input lock across udev socket handling

This avoids having the server running inside libudev from two threads
at once, which it appears to not like.
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent de5291c0
......@@ -345,9 +345,12 @@ socket_handler(int fd, int ready, void *data)
struct udev_device *udev_device;
const char *action;
input_lock();
udev_device = udev_monitor_receive_device(udev_monitor);
if (!udev_device)
if (!udev_device) {
input_unlock();
return;
}
action = udev_device_get_action(udev_device);
if (action) {
if (!strcmp(action, "add")) {
......@@ -364,6 +367,7 @@ socket_handler(int fd, int ready, void *data)
device_removed(udev_device);
}
udev_device_unref(udev_device);
input_unlock();
}
int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment