aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/arch
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2007-07-01 18:38:42 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2007-07-01 18:38:42 +0000
commit8e1d5ef3729423889b73a121695fc83fb9cd338c (patch)
treeb5c9637751cc6e186b3b83cd797717f4b2e13faf /hardinfo2/arch
parentc54d47775818f19297e03e2f1b1b0031d77878fb (diff)
A bunch of cleanups.
Diffstat (limited to 'hardinfo2/arch')
-rw-r--r--hardinfo2/arch/linux/common/filesystem.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/hardinfo2/arch/linux/common/filesystem.h b/hardinfo2/arch/linux/common/filesystem.h
index 8300f278..74c019e0 100644
--- a/hardinfo2/arch/linux/common/filesystem.h
+++ b/hardinfo2/arch/linux/common/filesystem.h
@@ -23,15 +23,23 @@
static gchar *fs_list = NULL;
+static gboolean
+remove_filesystem_entries(gpointer key, gpointer value, gpointer data)
+{
+ return g_str_has_prefix(key, "FS");
+}
+
static void
scan_filesystems(void)
{
FILE *mtab;
gchar buf[1024];
struct statfs sfs;
+ int count = 0;
g_free(fs_list);
fs_list = g_strdup("");
+ g_hash_table_foreach_remove(moreinfo, remove_filesystem_entries, NULL);
mtab = fopen("/etc/mtab", "r");
if (!mtab)
@@ -71,7 +79,7 @@ scan_filesystems(void)
strstr(tmp[3], "rw") ? "Read-Write" :
"Read-Only", tmp[1], strsize, strused,
stravail);
- g_hash_table_insert(moreinfo, g_strdup(tmp[0]), strhash);
+ g_hash_table_insert(moreinfo, g_strdup_printf("FS%d", ++count), strhash);
fs_list = g_strdup_printf("%s$%s$%s=%s total, %s free\n",
fs_list,