[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] FreeMiNT & MiNTlib patchset - add new support



Frank,

Actually the filesystem code does need modifying.

Take this snippet of diff for example.

Index: sys/xfs/ext2fs/ext2dev.c
===================================================================
RCS file: /mint/freemint/sys/xfs/ext2fs/ext2dev.c,v
retrieving revision 1.9
diff -u -r1.9 ext2dev.c
--- sys/xfs/ext2fs/ext2dev.c    13 Jul 2007 21:32:53 -0000      1.9
+++ sys/xfs/ext2fs/ext2dev.c    29 Aug 2008 14:40:31 -0000
@@ -72,8 +72,11 @@

        if (!EXT2_ISREG (le2cpu16 (c->in.i_mode)))
        {
-               DEBUG (("Ext2-FS [%c]: e_open: not a regular file (#%
ld)", f->fc.dev+'A', c->inode));
-               return EACCES;
+               if (!(EXT2_ISDIR (le2cpu16 (c->in.i_mode)) && 
+                    ((f->flags & O_RWMODE) == O_RDONLY))) {
+                       DEBUG (("Ext2-FS [%c]: e_open: not a regular
file or read-only directory (#%ld)", f->fc.dev+'A', c->inode));
+                       return EACCES;
+               }
        }

        if (((f->flags & O_RWMODE) == O_WRONLY)

The !EXT2_ISREG(..) test will fail when a directory is passed in.

So we do need to modify the filesystem code regardless.

Alan.