Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv26684
Modified Files:
volume.c
Log Message:
Fix minor buglet in volume.c and tidy up white space.
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/volume.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -U2 -r1.34 -r1.35
--- volume.c 23 Apr 2002 08:29:13 -0000 1.34
+++ volume.c 23 Apr 2002 08:37:07 -0000 1.35
@@ -599,6 +599,4 @@
}
-
-
/**
* ntfs_check_if_mounted - check if an ntfs volume is currently mounted
@@ -611,29 +609,27 @@
* If the device is currently mounted, ntfs_check_if_mounted() will return
* +1, otherwise return 0.
- *
- **/
+ */
int ntfs_check_if_mounted(const char *dev)
{
- FILE *m_f;
+ FILE *m_f;
struct stat sbuf;
- struct mntent *mnt;
+ struct mntent *mnt;
/* First verify we are dealing with a valid block device. */
if (stat(dev, &sbuf) == -1) {
- errno = ENODEV;
- return -1;
+ errno = ENODEV;
+ return -1;
}
-
+
if (!(m_f = setmntent(MOUNTED, "r")))
- return -errno;
+ return -1;
while ((mnt = getmntent(m_f)))
if (!strcmp(dev, mnt->mnt_fsname))
break;
endmntent(m_f);
+
if (!mnt)
return 0;
- else
- return 1;
-
-
+ return 1;
}
+
|