SHA256
1
0
forked from pool/dosfstools
dosfstools/dosfstools-subfs.patch

22 lines
738 B
Diff

--- mkdosfs/mkdosfs.c.orig 2003-06-14 22:07:08.000000000 +0200
+++ mkdosfs/mkdosfs.c 2005-02-15 16:02:35.175598263 +0100
@@ -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);
}