diff options
| author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-01-06 12:47:33 +0000 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-01-06 12:47:33 +0000 | 
| commit | 5862c823a3dca7a95027134b05b731d46d0db1d7 (patch) | |
| tree | d02cb0811f08442cb5fa6eaeeead159f69b1ac06 /hardinfo2/arch/linux | |
| parent | be3013df51de306e4494419c595727569ad2c284 (diff) | |
Let the fun begin! :)
Diffstat (limited to 'hardinfo2/arch/linux')
| -rw-r--r-- | hardinfo2/arch/linux/common/devmemory.h | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/hardinfo2/arch/linux/common/devmemory.h b/hardinfo2/arch/linux/common/devmemory.h index 6b3353a7..780ab12f 100644 --- a/hardinfo2/arch/linux/common/devmemory.h +++ b/hardinfo2/arch/linux/common/devmemory.h @@ -21,13 +21,14 @@ static GHashTable *memlabels;  static void __scan_memory()  {      gchar **keys, *tmp; -    static gint linux24_offset = -1; +    static gint 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); +    if (offset == -1) { +        /* gah. linux 2.4 adds three lines of data we don't need in +           /proc/meminfo */ +        offset = strstr(idle_free(module_call_method("computer::getOSKernel")), +                        "Linux 2.4") ? 3 : 0;      }      g_file_get_contents("/proc/meminfo", &meminfo, NULL, NULL); @@ -40,7 +41,7 @@ static void __scan_memory()      meminfo = g_strdup("");      lginterval = g_strdup(""); -    for (i = linux24_offset; keys[i]; i++) { +    for (i = offset; keys[i]; i++) {          gchar **newkeys = g_strsplit(keys[i], ":", 0);          if (!newkeys[0]) { | 
