path: make sure udev devices are initialized before usage
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 3 Feb 2015 04:18:15 +0000 (14:18 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 3 Feb 2015 22:14:50 +0000 (08:14 +1000)
commitbcb6f22d89783418b70363d6a2fddefd450c441d
tree03b8cd1a42f9a67196f7736cd62fc3537f894763
parent26140aba235fe91257b8ee7fb3178c92f20a5229
path: make sure udev devices are initialized before usage

When creating uinput devices, we get the devnode from the kernel directly
rather than through udev. When we add this to the path backend too quickly the
udev_device we get may not be fully initialized and properties may be missing.
This causes false test results.

Avoid this by making sure the handle we have is initialized. This should never
trigger on a real device anyway, even creating a device through litest is slow
enough to avoid this issue. Only affected are the tests in misc.c where we
create the uinput device directly.

Nonetheless, handle this for the generic case so we don't run into heisenbugs
later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/path.c