]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: avoid canonicalizing pseudofs paths
authorDave Reisner <d@falconindy.com>
Tue, 17 Jan 2012 01:17:55 +0000 (20:17 -0500)
committerKarel Zak <kzak@redhat.com>
Tue, 17 Jan 2012 10:11:20 +0000 (11:11 +0100)
This fixes a display bug in the new mount wherein a psuedofs existing in
$PWD by name will be resolved and shown as a real mount point.

  $ cd /tmp; mkdir nfsd; mount | grep nfsd
  /tmp/nfsd on /proc/fs/nfsd type nfsd (rw,relatime)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
sys-utils/mount.c

index 81ccb411b38515d8fb1ffd4cea77e6c2aefe869e..0964828f5d9119bb4a602373c1dfe50e7e6f0b63 100644 (file)
@@ -146,13 +146,14 @@ static void print_all(struct libmnt_context *cxt, char *pattern, int show_label)
                const char *type = mnt_fs_get_fstype(fs);
                const char *src = mnt_fs_get_source(fs);
                const char *optstr = mnt_fs_get_options(fs);
-               char *xsrc;
+               char *xsrc = NULL;
 
                if (type && pattern && !mnt_match_fstype(type, pattern))
                        continue;
 
-               xsrc = mnt_pretty_path(src, cache);
-               printf ("%s on %s", xsrc, mnt_fs_get_target(fs));
+               if (!mnt_fs_is_pseudofs(fs))
+                       xsrc = mnt_pretty_path(src, cache);
+               printf ("%s on %s", xsrc ? xsrc : src, mnt_fs_get_target(fs));
                if (type)
                        printf (" type %s", type);
                if (optstr)