diff options
Diffstat (limited to 'hardinfo2/arch/linux/common/modules.h')
-rw-r--r-- | hardinfo2/arch/linux/common/modules.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/hardinfo2/arch/linux/common/modules.h b/hardinfo2/arch/linux/common/modules.h index 46f73d2f..32c9c0d6 100644 --- a/hardinfo2/arch/linux/common/modules.h +++ b/hardinfo2/arch/linux/common/modules.h @@ -29,12 +29,18 @@ remove_module_devices(gpointer key, gpointer value, gpointer data) return g_str_has_prefix(key, "MOD"); } +static GHashTable *_module_hash_table = NULL; + static void scan_modules_do(void) { FILE *lsmod; gchar buffer[1024]; + if (!_module_hash_table) { + _module_hash_table = g_hash_table_new(g_str_hash, g_str_equal); + } + if (module_list) { g_free(module_list); } @@ -95,7 +101,15 @@ scan_modules_do(void) if (description && g_str_equal(description, "<none>")) { g_free(description); description = g_strdup(""); - } + + g_hash_table_insert(_module_hash_table, + g_strdup(modname), + g_strdup_printf("Kernel module (%s)", modname)); + } else { + g_hash_table_insert(_module_hash_table, + g_strdup(modname), + g_strdup(description)); + } /* append this module to the list of modules */ module_list = h_strdup_cprintf("$%s$%s=%s\n", |