dosfstools/dosfstools-2.11-subfs.patch

22 lines
661 B
Diff
Raw Normal View History

--- mkdosfs/mkdosfs.c
+++ mkdosfs/mkdosfs.c
@@ -592,11 +592,15 @@
FILE *f;
struct mntent *mnt;
- if ((f = setmntent (MOUNTED, "r")) == NULL)
- return;
+ if ((f = setmntent ("/proc/mounts", "r")) == NULL)
+ if ((f = setmntent (MOUNTED, "r")) == NULL)
+ return;
while ((mnt = getmntent (f)) != NULL)
if (strcmp (device_name, mnt->mnt_fsname) == 0)
- die ("%s contains a mounted file system.");
+ if (strcmp ("subfs", mnt->mnt_type) != 0)
+ die ("%s contains a mounted file system.");
+ else
+ printf("Device mounted using subfs, please do not access it while creating filesystem\n");
endmntent (f);
}