hidpp files were using the error function from error.h header file.
Unfortunately not every libc comes with this particular header file, so
with this patch we won't be requiring to be rely on error function and
use fprintf function.
Thanks to developer Yaroslav Chvanov <staticssleever668> for the
original suggestion
Closes: https://github.com/libratbag/libratbag/issues/1253
Signed-off-by: listout <listout@protonmail.com>
gcc 10 complains about multiple definitions of these when linking.
/usr/bin/ld: libhidpp.a(src_hidpp-generic.c.o):/builddir/build/BUILD/libratbag-0.12/x86_64-redhat-linux-gnu/../src/libratbag-private.h:588:
multiple definition of `etekcity_driver';
libutil.a(src_libratbag-util.c.o):/builddir/build/BUILD/libratbag-0.12/x86_64-redhat-linux-gnu/../src/libratbag-private.h:588:
first defined here
Special case here is the test_driver struct, without the extern gcc seems to
think it's a new struct with all zeros, causing a segfault when we then try to
strcmp the test driver name.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When the API version mismatches we want to fail early before performing
any more complex initialisation. We do however have to check for
devices first so that we can distinguish cases where we cannot access
the daemon from those where it is too old to provide an API version.
If access failed, e.g. due to insufficient permissions, don't confuse
the user by reporting an API mismatch.
This is a minimal improvement to target issue #802. As, if access is
restricted to a group, that group is known in Meson, it would even be
possible to report that group in the error message. But, that would
require converting ratbagd.py to a template or finding some other way to
inject that information at build time.
- File "./build/ratbag-command", line 2289, in open_ratbagd
r = Ratbagd(1)
TypeError: __init__() takes 1 positional argument but 2 were given
- AttributeError: module 'libratbag' has no attribute
'ratbag_device_get_bus'
- File "./build/ratbag-command", line 267, in model
return "{}:{04x}:{04x}:{d}".format(bus, vid, pid, version)
KeyError: '04x'
- swig/python detected a memory leak of type 'uint32_t *', no destructor
found.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Bumped copyright to 2019.
Fixed typo in profile.capabilities description.
only ratbagd.py: Removed vim helper line since the file has a proper file extension.
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
While the DBus API is still in flux, things can break at any time.
Keeping piper and libratbag in version-step works terribly, doubly so where
piper is flatpaked but ratbagd comes from some repo somewhere. We can't check
at build-time, we can't run ratbagd --version at runtime.
so let's add a version field for now and drop it if we ever get to stable.
Meanwhile, ratbagd.py will throw an exception if the expected version doesn't
match exactly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Force the tests to load a test device with JSON that matches their
expectations instead of having a magic device pre-setup where the tests have
to know what the values are.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't rely on some other tool to install the policy file, let's just do this
in ratbagd.devel directly so it's immediately executable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Which is the same env that ratbagd uses as well. And we don't have variable
values in RATBAGCTL_DEVEL anymore, so no point in having two different
variables here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This makes it possible to run the script against a manually started
ratbagd.devel - with a lot less effort.
And since we're don't need to be root to do this, let's move that check too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This makes it a lot easier to start ratbagd.devel in gdb, then run
ratbagctl.devel against it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We already have a separate name for the devel bus anyway, the git sha doesn't
give us a huge amount of benefits but makes manual debugging a major PITA.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When there's a bug that's triggered by the test suite it's hard to figure out
what exactly crashes. So allow starting ratbagd.devel manually and run the
test suite against that process so we can gdb it.
The steps required for this are a bit insane, so the instructions are listed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>