From 5d13d526bfb45a9194d08039dcb8ce74c65898b3 Mon Sep 17 00:00:00 2001 From: matteo Date: Sun, 3 Feb 2008 17:23:58 +0000 Subject: Fix printing of unionfs mounts when using the -p option PR: bin/75585 MFC after: 1 week --- sbin/mount/mount.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sbin') 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, "", 7) == 0 || + strncmp(ent->f_mntfromname, "", 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. -- cgit v1.1