Fix dlopen issue for libsensors5 in Debian Buster, Bullseye

libsensors.so is provided only by the -dev package, so search for
libsensors.so.5 (installed from the libsensors5 package) explicitly

see: dpkg-query -S libsensors.so
This commit is contained in:
Daniel Lange 2020-12-12 20:08:17 +01:00
parent 738d31b903
commit 12421f460a
1 changed files with 7 additions and 3 deletions

View File

@ -21,9 +21,13 @@ static void* dlopenHandle = NULL;
int LibSensors_init(FILE* input) {
if (!dlopenHandle) {
dlopenHandle = dlopen("libsensors.so", RTLD_LAZY);
dlopenHandle = dlopen("libsensors.so.", RTLD_LAZY);
if (!dlopenHandle) {
/* Debian contains no unversioned .so in libsensors5, only in the -dev package, so work around that: */
dlopenHandle = dlopen("libsensors.so.5", RTLD_LAZY);
if (!dlopenHandle)
goto dlfailure;
}
/* Clear any errors */
dlerror();