util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Reisner <d@falconindy.com>
To: util-linux@vger.kernel.org
Cc: Dave Reisner <dreisner@archlinux.org>
Subject: [PATCH] mount: avoid canonicalizing pseudofs paths
Date: Mon, 16 Jan 2012 20:17:55 -0500	[thread overview]
Message-ID: <1326763075-11690-1-git-send-email-dreisner@archlinux.org> (raw)

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 |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 81ccb41..0964828 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -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)
-- 
1.7.8.3


             reply	other threads:[~2012-01-17  1:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17  1:17 Dave Reisner [this message]
2012-01-17 10:14 ` [PATCH] mount: avoid canonicalizing pseudofs paths Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326763075-11690-1-git-send-email-dreisner@archlinux.org \
    --to=d@falconindy.com \
    --cc=dreisner@archlinux.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).