Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux/hidraw: Ensure udev has initialized device before hid_enumerate returns it #220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrpippy
Copy link
Contributor

@mrpippy mrpippy commented Apr 8, 2015

In hid_enumerate(), skip any devices which have not yet been initialized by udev (which includes setting permissions on the device node).
Previously, a race condition was possible where hid_enumerate() could return a device that hid_open() could not open, because udev had not set permissions on the device node yet.

This resolves issue 217, "Occasional 'permission denied' when opening device" (#217)

… returns it

In hid_enumerate(), skip any devices which have not yet been initialized by udev (which includes setting permissions on the device node).
Previously, a race condition was possible where hid_enumerate() could return a device that hid_open() could not open, because udev had not set permissions on the device node yet.

This resolves issue 217, "Occasional 'permission denied' when opening device" (signal11#217)
@signal11
Copy link
Owner

signal11 commented Apr 9, 2015

Looks good to me

@mrpippy
Copy link
Contributor Author

mrpippy commented Jun 22, 2015

One drawback I found while compiling under Ubuntu 10.04: udev didn't add the udev_device_get_is_initialized() call until udev 165 in Dec 2010. Could be a problem for anyone who needs to support old distros

@mrpippy
Copy link
Contributor Author

mrpippy commented Feb 7, 2017

Can this be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants