The returned errno from libevdev_input_create_from_device was returned
incorrectly because libevdev_uinput_destroy() would try to close the
unset value of ->fd, overwriting errno.
That was fixed in debe9b030c, this patch avoids
the ioctl/close calls if the fd isn't set.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Some devices scale the frequency based on the input and will provide
recordings with different frequencies each time. Recommend to measure multiple
times since we can only know what the highest frequency is.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
clang looks at GCC pragmas, but doesn't understand -Woverride-init. Instead,
it uses -Winitializer-overrides.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Relative devices don't provide a physical resolution to the host. For things
like pointer acceleration, the physical amount of movement is better as
baseline than the movement in device units.
Alas, many devices don't come with any information at all, so the users have
to guess. Help that guesswork by providing a tool that does the calculations
for them.
This tool measures the device units covered, then prints the frequency and an
lookup table for various resolutions (in dpi) to match to the physical
movement of the device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
These were removed in (7da329b) because for some reason they got copied into
the output. That was either a buggy doxygen or just some other problem. Add
them again, makes it much easier to read the header file.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When building for multiple prefixes from the same repo it's nice to see a
reminder for what the current prefix is.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
I can't recommend it, but I can't stop people from doing it, so at least
document the ground rules.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We ignore anything that starts with an underscore, anything that starts with
libevdev and main (since we test the test-static-link binary) and a couple of
gcov-related functions. This should catch any functions we accidentally
export.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We rebuild the libevdev object files with the gcov flags for the tests, so we
need to make sure those flags are present on all binaries.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This can't fail in the kernel anyway, so cast it to shut up Coverity.
Error message:
"Calling function "ioctl(int, unsigned long, ...)" without checking return
value (as is done elsewhere 35 out of 36 times)."
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Using LIBEVDEV_UINPUT_OPEN_MANAGED can leak the fd if an error occurs after
opening it.
Found by Coverity.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The static library currently leaks log_msg and log_priority. Both are too
generic, so rename them, with a leading underscore to hint they're supposed to
be private.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12717d79 "Add libevdev_event_type/code_from_name() resolvers" added the
lookup functions for types and codes, this commit adds the missing ones for
input properties.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The python check was inserted between "checking whether to build with gcov"
and the answering "yes", causing a lonely "yes" or "no" to wander around the
config.log in vain, haunted by solitude and wondering about the binary
simplicity of its life.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A simple ck_assert() just fails, a ck_assert_int_eq() also shows the two
values. Makes failures a bit easier to debug.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We use the negative errno internally, but the proper errno is always positive.
Fixes device creation failures on kernels that don't support UI_SET_PROPBIT.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>