diff options
author | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:48 -0500 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:48 -0500 |
commit | 4979bb6cbbbe39eb44c32530cd13f86bf44e5d77 (patch) | |
tree | 614372cf2510ad45311ecea088012683635d0b76 /arch/linux/common/sensors.h | |
parent | ee6c3f9b4cf08a276c971dee66e1acdb32b3dff9 (diff) |
Import Upstream version 0.5c
Diffstat (limited to 'arch/linux/common/sensors.h')
-rw-r--r-- | arch/linux/common/sensors.h | 17 |
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; } |