netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=ed267ba555dd2d329ece8572a18eb9ce1763752c

commit ed267ba555dd2d329ece8572a18eb9ce1763752c
Author: Alastair Poole <[email protected]>
Date:   Mon Jun 8 11:23:12 2020 +0100

    fbsd: fs type name.
---
 src/bin/system/filesystems.c | 10 +++++++---
 src/bin/ui/ui_disk.c         |  4 +++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/bin/system/filesystems.c b/src/bin/system/filesystems.c
index d681417..4632ea3 100644
--- a/src/bin/system/filesystems.c
+++ b/src/bin/system/filesystems.c
@@ -107,19 +107,20 @@ static _magic _magique[] = {
 unsigned int
 filesystem_id_by_name(const char *name)
 {
-   for (int i = 0; i < sizeof(_magique); i++)
+   size_t n = sizeof(_magique) / sizeof(_magic);
+   for (int i = 0; i < n; i++)
      {
         if (!strcasecmp(name, _magique[i].name))
           return _magique[i].magic;
      }
-
    return 0;
 }
 
 const char *
 filesystem_name_by_id(unsigned int id)
 {
-   for (int i = 0; i < sizeof(_magique); i++)
+   size_t n = sizeof(_magique) / sizeof(_magic);
+   for (int i = 0; i < n; i++)
      {
         if (_magique[i].magic == id)
           return _magique[i].name;
@@ -144,6 +145,9 @@ filesystem_info_get(const char *path)
    fs->mount = strdup(mountpoint);
    fs->path  = strdup(path);
    fs->type  = stats.f_type;
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+   fs->type_name = strdup(stats.f_fstypename);
+#endif
    fs->usage.total = stats.f_bsize * stats.f_blocks;
    fs->usage.used  = fs->usage.total - (stats.f_bsize * stats.f_bfree);
 
diff --git a/src/bin/ui/ui_disk.c b/src/bin/ui/ui_disk.c
index 26b35c4..a78d319 100644
--- a/src/bin/ui/ui_disk.c
+++ b/src/bin/ui/ui_disk.c
@@ -44,7 +44,9 @@ _ui_disk_add(Ui *ui, Filesystem_Info *inf)
    const char *type;
    double ratio, value;
 
-   type = filesystem_name_by_id(inf->type);
+   type = inf->type_name;
+   if (!type)
+     type = filesystem_name_by_id(inf->type);
    if (!type) type = "unknown";
 
    box = elm_box_add(ui->disk_activity);

-- 


Reply via email to