More detailed logging of hid_init() on unixes to detect why
loading of "libudev.so.1" or "libudev.so.0" failed.
This commit is contained in:
parent
c73493eba5
commit
ccbf5379ab
2 changed files with 11 additions and 2 deletions
|
@ -159,7 +159,7 @@ static int hid_wrapper_udev_init()
|
||||||
{
|
{
|
||||||
// Error, close the shared library handle and finish.
|
// Error, close the shared library handle and finish.
|
||||||
hid_wrapper_udev_close();
|
hid_wrapper_udev_close();
|
||||||
return -1;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success.
|
// Success.
|
||||||
|
|
|
@ -473,7 +473,16 @@ void Mouse3DController::run()
|
||||||
int res = hid_init();
|
int res = hid_init();
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
// Give up.
|
// Give up.
|
||||||
BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library";
|
#if defined(__unix__) || defined(__unix) || defined(unix)
|
||||||
|
if (res == -1)
|
||||||
|
// Hopefully this error code comes from our bundled patched hidapi. In that case, -1 is returned by hid_wrapper_udev_init() and it mean
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library: failed to load libudev.so.1 or libudev.so.0";
|
||||||
|
else if (res == -2)
|
||||||
|
// Hopefully this error code comes from our bundled patched hidapi. In that case, -2 is returned by hid_wrapper_udev_init() and it mean
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library: failed to resolve some function from libudev.so.1 or libudev.so.0";
|
||||||
|
else
|
||||||
|
#endif // unixes
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue