aboutsummaryrefslogtreecommitdiff
path: root/arch/linux/common/sensors.h
diff options
context:
space:
mode:
authorAgney Lopes Roth Ferraz <agney@debian.org>2009-03-28 22:55:02 -0300
committerSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:48 -0500
commit1b6665085f47e0a86e4bebd5e313a2ab63600eb4 (patch)
tree6b7dedc1886b42d07cc48359470fe3f595500cc8 /arch/linux/common/sensors.h
parent819c0c3382b06fc0f0a1679465966f811aa2e0f8 (diff)
parent4979bb6cbbbe39eb44c32530cd13f86bf44e5d77 (diff)
Import Debian changes 0.5c-1
hardinfo (0.5c-1) unstable; urgency=low * New upstream version. (Closes: #517591, #511237, #457703, #519256, #449250, #457820, #497758)
Diffstat (limited to 'arch/linux/common/sensors.h')
-rw-r--r--arch/linux/common/sensors.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/linux/common/sensors.h b/arch/linux/common/sensors.h
index 1c4fd69f..17637764 100644
--- a/arch/linux/common/sensors.h
+++ b/arch/linux/common/sensors.h
@@ -1,6 +1,6 @@
/*
* HardInfo - Displays System Information
- * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br>
+ * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@hardinfo.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,9 +31,16 @@ static void read_sensor_labels(gchar * driver)
g_free, g_free);
sensor_compute = g_hash_table_new(g_str_hash, g_str_equal);
- conf = fopen("/etc/sensors.conf", "r");
- if (!conf)
- return;
+ /* Try to open lm-sensors config file sensors3.conf */
+ conf = fopen("/etc/sensors3.conf", "r");
+
+ /* If it fails, try to open sensors.conf */
+ if (!conf) conf = fopen("/etc/sensors.conf", "r");
+
+ if (!conf) {
+ /* Cannot open config file. */
+ return;
+ }
while (fgets(buf, 256, conf)) {
line = buf;
@@ -100,7 +107,7 @@ static void read_sensor_labels(gchar * driver)
for (i = 1; chips[i]; i++) {
strend(chips[i], '*');
- if (g_str_has_prefix(driver, chips[i] + 1)) {
+ if (g_str_has_prefix(chips[i] + 1, driver)) {
lock = TRUE;
break;
}