aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2015-12-21 22:19:22 +0000
committerAlan Somers <asomers@FreeBSD.org>2015-12-21 22:19:22 +0000
commitb5bbeb21179e09b5e84edf286e6c1741c00b574a (patch)
tree542cb66a20a783d96ac83927ea17c16a44054d27 /sbin/mount
parenta0becfc9782f4f168545a0f17d234d2ca1db0f84 (diff)
downloadsrc-b5bbeb21179e09b5e84edf286e6c1741c00b574a.tar.gz
src-b5bbeb21179e09b5e84edf286e6c1741c00b574a.zip
Notes
Diffstat (limited to 'sbin/mount')
-rw-r--r--sbin/mount/mount.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 6427fc8b7ff3..8c68467465c1 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -485,10 +485,18 @@ ismounted(struct fstab *fs, struct statfs *mntbuf, int mntsize)
strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile));
}
+ /*
+ * Consider the filesystem to be mounted if:
+ * It has the same mountpoint as a mounted filesytem, and
+ * It has the same type as that same mounted filesystem, and
+ * It has the same device name as that same mounted filesystem, OR
+ * It is a nonremountable filesystem
+ */
for (i = mntsize - 1; i >= 0; --i)
if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 &&
+ strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 &&
(!isremountable(fs->fs_vfstype) ||
- strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0))
+ (strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)))
return (1);
return (0);
}