From 12421f460a798d34a1e6277a1c37cce78fa4956b Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Sat, 12 Dec 2020 20:08:17 +0100 Subject: [PATCH] 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 --- linux/LibSensors.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/linux/LibSensors.c b/linux/LibSensors.c index a30e21b6..d006874f 100644 --- a/linux/LibSensors.c +++ b/linux/LibSensors.c @@ -21,9 +21,13 @@ static void* dlopenHandle = NULL; int LibSensors_init(FILE* input) { if (!dlopenHandle) { - dlopenHandle = dlopen("libsensors.so", RTLD_LAZY); - if (!dlopenHandle) - goto dlfailure; + 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();