Merge branch 'fix-dlopen-libsensors-debian' of fasterit/htop

This commit is contained in:
Daniel Lange 2020-12-13 20:09:06 +01:00
commit f8a610e6e1
1 changed files with 7 additions and 3 deletions

View File

@ -21,9 +21,13 @@ static void* dlopenHandle = NULL;
int LibSensors_init(FILE* input) { int LibSensors_init(FILE* input) {
if (!dlopenHandle) { 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) if (!dlopenHandle)
goto dlfailure; goto dlfailure;
}
/* Clear any errors */ /* Clear any errors */
dlerror(); dlerror();