diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2008-02-24 15:23:29 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2008-02-24 15:23:29 +0000 |
commit | 1b225ecae8f9b55879d07185d4c9a39613dd10a8 (patch) | |
tree | e6852d7a25af0b6b3c0d2474a4f0bc220b7d808f /hardinfo2/arch/linux/common | |
parent | 96845586e3d4a1d8a0fdbe381478d85ec42a8d74 (diff) |
Fix compilation warnings, add patch by moma (ubuntu bug #178600).
Diffstat (limited to 'hardinfo2/arch/linux/common')
-rw-r--r-- | hardinfo2/arch/linux/common/modules.h | 2 | ||||
-rw-r--r-- | hardinfo2/arch/linux/common/sensors.h | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/hardinfo2/arch/linux/common/modules.h b/hardinfo2/arch/linux/common/modules.h index 6fbe13bd..4ae3a960 100644 --- a/hardinfo2/arch/linux/common/modules.h +++ b/hardinfo2/arch/linux/common/modules.h @@ -119,7 +119,7 @@ scan_modules_do(void) "License=%s\n", NONE_IF_NULL(filename), memory / 1024.0, - NONE_IF_NULL(modname), + modname, NONE_IF_NULL(description), NONE_IF_NULL(vermagic), NONE_IF_NULL(author), diff --git a/hardinfo2/arch/linux/common/sensors.h b/hardinfo2/arch/linux/common/sensors.h index 1c4fd69f..317d2ebb 100644 --- a/hardinfo2/arch/linux/common/sensors.h +++ b/hardinfo2/arch/linux/common/sensors.h @@ -31,9 +31,17 @@ 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. */ + fprintf(stderr, "Cannot open /etc/sensors.conf file.\n"); + return; + } while (fgets(buf, 256, conf)) { line = buf; @@ -100,7 +108,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; } |