[gnome-control-center] info: show disk info even if there's no /etc/fstab file



commit 611eb340289fcb416f766e4acedfbfdcaaa2ceed
Author: Jonh Wendell <jonh wendell intel com>
Date:   Mon Jul 22 16:15:57 2013 -0300

    info: show disk info even if there's no /etc/fstab file
    
    the g_unix_mount_points_get() function checks for entry mount
    points. if there are none, it returns NULL and we end up showing
    no information about disks.
    
    if that's the case, this patch calls g_unix_mounts_get() which
    checks for mounted filesystems in /etc/mtab.
    
    also we need to update the list of ignored filesystems to
    include rootfs, which is always present and is a duplicate of
    an actual filesystem mount point.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704702

 panels/info/cc-info-panel.c         |    5 +++++
 panels/info/gsd-disk-space-helper.c |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index 1f79540..c863f1f 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -608,6 +608,11 @@ get_primary_disc_info (CcInfoPanel *self)
   GList        *p;
 
   points = g_unix_mount_points_get (NULL);
+
+  /* If we do not have /etc/fstab around, try /etc/mtab */
+  if (points == NULL)
+    points = g_unix_mounts_get (NULL);
+
   for (p = points; p != NULL; p = p->next)
     {
       GUnixMountEntry *mount = p->data;
diff --git a/panels/info/gsd-disk-space-helper.c b/panels/info/gsd-disk-space-helper.c
index 1987337..455520d 100644
--- a/panels/info/gsd-disk-space-helper.c
+++ b/panels/info/gsd-disk-space-helper.c
@@ -71,6 +71,7 @@ gsd_should_ignore_unix_mount (GUnixMountEntry *mount)
                 "proc",
                 "procfs",
                 "ptyfs",
+                "rootfs",
                 "rpc_pipefs",
                 "selinuxfs",
                 "smbfs",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]