fix jffs2reset on ubifs overlay
[project/fstools.git] / libfstools / find.c
index 71548f5..d9df173 100644 (file)
@@ -73,7 +73,7 @@ find_mount(char *mp)
 }
 
 char*
 }
 
 char*
-find_mount_point(char *block, char *fs)
+find_mount_point(char *block, int mtd_only)
 {
        FILE *fp = fopen("/proc/mounts", "r");
        static char line[256];
 {
        FILE *fp = fopen("/proc/mounts", "r");
        static char line[256];
@@ -96,7 +96,9 @@ find_mount_point(char *block, char *fs)
                        *t = '\0';
                        t++;
 
                        *t = '\0';
                        t++;
 
-                       if (fs && strncmp(t, fs, strlen(fs))) {
+                       if (mtd_only &&
+                           strncmp(t, "jffs2", 6) &&
+                           strncmp(t, "ubifs", 6)) {
                                fclose(fp);
                                fprintf(stderr, "block is mounted with wrong fs\n");
                                return NULL;
                                fclose(fp);
                                fprintf(stderr, "block is mounted with wrong fs\n");
                                return NULL;