summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-12-25 10:07:47 +0100
committerBenBE <BenBE@geshi.org>2020-12-25 13:05:37 +0100
commitca9d7cd70827279dbeab32accd4aaadece317c1b (patch)
tree8929a670cddd3ff0f0fc538ac0e7053241690ee6
parentdebeac49cd1990bdaab5e2b2fdc77f658a806f72 (diff)
Also find libsensors.so.4 for Fedora and friends
-rw-r--r--linux/LibSensors.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/linux/LibSensors.c b/linux/LibSensors.c
index 5e119350..3df327c2 100644
--- a/linux/LibSensors.c
+++ b/linux/LibSensors.c
@@ -23,13 +23,15 @@ static void* dlopenHandle = NULL;
int LibSensors_init(FILE* input) {
if (!dlopenHandle) {
+ /* Find the unversioned libsensors.so (symlink) and prefer that, but Debian has .so.5 and Fedora .so.4 without
+ matching symlinks (unless people install the -dev packages) */
dlopenHandle = dlopen("libsensors.so", RTLD_LAZY);
- if (!dlopenHandle) {
- /* Debian contains no unversioned .so in libsensors5, only in the -dev package, so work around that: */
+ if (!dlopenHandle)
dlopenHandle = dlopen("libsensors.so.5", RTLD_LAZY);
- if (!dlopenHandle)
- goto dlfailure;
- }
+ if (!dlopenHandle)
+ dlopenHandle = dlopen("libsensors.so.4", RTLD_LAZY);
+ if (!dlopenHandle)
+ goto dlfailure;
/* Clear any errors */
dlerror();

© 2014-2024 Faster IT GmbH | imprint | privacy policy