Used /proc/mounts for checking existing mounts

The file /etc/mtab is traditionally checked to avoid multiple mountings
of the same device, but this is not accurate enough in some conditions.
So use /proc/mounts when available and fall back to /etc/mtab on
systems which do not have /proc/mounts.
edge.strict_endians
Jean-Pierre André 2013-04-22 18:37:51 +02:00
parent b35a204d01
commit 20801dc6a0
1 changed files with 2 additions and 1 deletions

View File

@ -1433,7 +1433,8 @@ static int ntfs_mntent_check(const char *file, unsigned long *mnt_flags)
err = errno;
goto exit;
}
if (!(f = setmntent(MOUNTED, "r"))) {
f = setmntent("/proc/mounts", "r");
if (!f && !(f = setmntent(MOUNTED, "r"))) {
err = errno;
goto exit;
}