diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-01-05 16:34:21 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-01-05 16:34:21 +0000 |
commit | 97a0e2a21cdb30193b6c5101ff29a8cb7cc39ebb (patch) | |
tree | 55d900984c913d965eb9125a4fbae058a4ced954 /hardinfo2/arch | |
parent | 448244afe83f875993408d09319d1458c4ea4e32 (diff) |
Some fixes for Linux 2.4.
Diffstat (limited to 'hardinfo2/arch')
-rw-r--r-- | hardinfo2/arch/linux/common/devmemory.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hardinfo2/arch/linux/common/devmemory.h b/hardinfo2/arch/linux/common/devmemory.h index cc4b1582..6b3353a7 100644 --- a/hardinfo2/arch/linux/common/devmemory.h +++ b/hardinfo2/arch/linux/common/devmemory.h @@ -21,8 +21,15 @@ static GHashTable *memlabels; static void __scan_memory() { gchar **keys, *tmp; + static gint linux24_offset = -1; gint i; + if (linux24_offset == -1) { + linux24_offset = idle_free(module_call_method("computer::isLinux2.4")) ? + 3 : 0; + DEBUG("linux24_offset=%d", linux24_offset); + } + g_file_get_contents("/proc/meminfo", &meminfo, NULL, NULL); keys = g_strsplit(meminfo, "\n", 0); @@ -33,7 +40,7 @@ static void __scan_memory() meminfo = g_strdup(""); lginterval = g_strdup(""); - for (i = 0; keys[i]; i++) { + for (i = linux24_offset; keys[i]; i++) { gchar **newkeys = g_strsplit(keys[i], ":", 0); if (!newkeys[0]) { |