diff options
author | Agney Lopes Roth Ferraz <agney@debian.org> | 2007-09-11 14:53:15 -0300 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:43 -0500 |
commit | 99a9c2a16af89bceed1f90c58faefd555a3268c3 (patch) | |
tree | 1e92d5f8160b4445b2459044400120e430f1fc23 /arch/linux/common/filesystem.h | |
parent | 0afab9fd83ec42e082ffa61f037519f3e1262e39 (diff) | |
parent | 7aeb5ac87c6105bd8fcc9b1fd12e37ba1550f587 (diff) |
Import Debian changes 0.4.2.2-1
hardinfo (0.4.2.2-1) unstable; urgency=low
* New upstream release.
* hardinfo now suggests mesa-utils (Closes: #435793)
Diffstat (limited to 'arch/linux/common/filesystem.h')
-rw-r--r-- | arch/linux/common/filesystem.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/linux/common/filesystem.h b/arch/linux/common/filesystem.h index 8300f278..d8166fc3 100644 --- a/arch/linux/common/filesystem.h +++ b/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,11 +79,11 @@ 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 = h_strdup_cprintf("$FS%d$%s=%s total, %s free\n", fs_list, - tmp[0], tmp[0], strsize, stravail); + count, tmp[0], strsize, stravail); g_free(strsize); g_free(stravail); |