Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15400/libntfs
Modified Files:
volume.c
Log Message:
Apply patch from Christophe.
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/volume.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -p -r1.55 -r1.56
--- volume.c 28 Sep 2005 13:47:48 -0000 1.55
+++ volume.c 10 Oct 2005 11:04:56 -0000 1.56
@@ -1277,10 +1277,13 @@ int ntfs_umount(ntfs_volume *vol,
static int ntfs_mntent_check(const char *file, unsigned long *mnt_flags)
{
struct mntent *mnt;
+#ifdef HAVE_REALPATH
char *real_file = NULL, *real_fsname = NULL;
+#endif
FILE *f;
int err = 0;
+#ifdef HAVE_REALPATH
real_file = malloc(PATH_MAX + 1);
if (!real_file)
return -1;
@@ -1293,15 +1296,21 @@ static int ntfs_mntent_check(const char
err = errno;
goto exit;
}
+#endif
if (!(f = setmntent(MOUNTED, "r"))) {
err = errno;
goto exit;
}
while ((mnt = getmntent(f))) {
+#ifdef HAVE_REALPATH
if (!realpath(mnt->mnt_fsname, real_fsname))
continue;
if (!strcmp(real_file, real_fsname))
break;
+#else
+ if (!strcmp(file, mnt->mnt_fsname))
+ break;
+#endif
}
endmntent(f);
if (!mnt)
@@ -1314,10 +1323,12 @@ static int ntfs_mntent_check(const char
*mnt_flags |= NTFS_MF_READONLY;
#endif
exit:
+#ifdef HAVE_REALPATH
if (real_file)
free(real_file);
if (real_fsname)
free(real_fsname);
+#endif
if (err) {
errno = err;
return -1;
|