summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authormatteo <matteo@FreeBSD.org>2008-02-03 17:23:58 +0000
committermatteo <matteo@FreeBSD.org>2008-02-03 17:23:58 +0000
commit5d13d526bfb45a9194d08039dcb8ce74c65898b3 (patch)
tree050bb034e07f21f12dcdb3488441dc631ec9ba6b /sbin
parent28b6852a92d608927fd77bed456abe4eeca9d580 (diff)
downloadFreeBSD-src-5d13d526bfb45a9194d08039dcb8ce74c65898b3.zip
FreeBSD-src-5d13d526bfb45a9194d08039dcb8ce74c65898b3.tar.gz
Fix printing of unionfs mounts when using the -p option
PR: bin/75585 MFC after: 1 week
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount/mount.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 99cab23..063660b 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -81,7 +81,7 @@ int mountfs(const char *, const char *, const char *,
int, const char *, const char *);
void remopt(char *, const char *);
void prmount(struct statfs *);
-void putfsent(const struct statfs *);
+void putfsent(struct statfs *);
void usage(void);
char *flags2opts(int);
@@ -805,7 +805,7 @@ usage(void)
}
void
-putfsent(const struct statfs *ent)
+putfsent(struct statfs *ent)
{
struct fstab *fst;
char *opts;
@@ -813,6 +813,12 @@ putfsent(const struct statfs *ent)
opts = flags2opts(ent->f_flags);
+ if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 ||
+ strncmp(ent->f_mntfromname, "<above>", 7) == 0) {
+ strcpy(ent->f_mntfromname, (strnstr(ent->f_mntfromname, ":", 8)
+ +1));
+ }
+
/*
* "rw" is not a real mount option; this is why we print NULL as "rw"
* if opts is still NULL here.
OpenPOWER on IntegriCloud